file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/atomics/wait/index.md | JavaScript - Global Objects - Atomics - wait - Examples:
Note that these examples cannot be run directly from the console or an arbitrary web page, because `SharedArrayBuffer` is not defined unless its security requirements are met. | [
0.8057531118392944,
0.6444934010505676,
-1.5948714017868042,
-0.07592888176441193,
-0.9609079957008362,
-0.16691501438617706,
0.6286852359771729,
0.2983589172363281,
-0.09134672582149506,
-0.28210413455963135,
0.1326991617679596,
0.08912698924541473,
-0.5754463076591492,
-0.413627237081527... |
javascript/reference/global_objects/atomics/wait/index.md | JavaScript - Global Objects - Atomics - wait - Examples - Using Atomics.wait():
Given a shared `Int32Array`:
Example:
// Create a SharedArrayBuffer with a size in bytes
const sab = new SharedArrayBuffer(1024);
const int32 = new Int32Array(sab);
A reading thread is sleeping and waiting on location 0 because the prov... | [
0.47192829847335815,
0.3442768156528473,
-0.5146477818489075,
0.21058423817157745,
0.052484191954135895,
-1.5087354183197021,
-0.5395297408103943,
0.15716974437236786,
0.17505298554897308,
0.1096426472067833,
0.08550484478473663,
-0.6282387375831604,
-0.4049193561077118,
-0.238422468304634... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify:
The `Atomics.notify()` static method notifies up some agents that are sleeping in the wait queue.
Note: This operation only works with an `Int32Array` or `BigInt64Array` that views a `SharedArrayBuffer`. It will return `0` on non-shared `ArrayBuffer` objects. | [
-0.1365317404270172,
-0.1596660614013672,
-0.4424765706062317,
-0.04914039373397827,
-0.5315471887588501,
-2.2562096118927,
0.29632505774497986,
1.0359772443771362,
-0.31485408544540405,
0.6652066707611084,
-0.46949610114097595,
-1.0751746892929077,
0.13300935924053192,
-0.2061960548162460... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify - Syntax:
Example:
Atomics.notify(typedArray, index, count) | [
0.48691028356552124,
0.15452441573143005,
-0.1620040237903595,
-0.29793664813041687,
-0.870509684085846,
-2.69569730758667,
-0.3526008129119873,
0.7582153081893921,
-0.32416868209838867,
-0.14756107330322266,
-0.18202748894691467,
-0.7215277552604675,
-0.3257211744785309,
0.100598819553852... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify - Syntax - Parameters:
- `typedArray`: An `Int32Array` or `BigInt64Array` that views a `SharedArrayBuffer`.
- `index`: The position in the `typedArray` to wake up on.
- `count` (optional): The number of sleeping agents to notify. Defaults to `Infinity`. | [
0.3029800057411194,
-0.3853840231895447,
-0.5664280652999878,
-0.20169803500175476,
-0.6347343325614929,
-1.6997456550598145,
0.13658468425273895,
0.7151762247085571,
0.31408610939979553,
0.12272121012210846,
-0.5335460305213928,
-0.46060317754745483,
-0.7385435700416565,
0.594667434692382... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify - Syntax - Return value:
Returns the number of woken up agents, or `0` if `typedArray` is a view on a non-shared `ArrayBuffer`. | [
0.3972780704498291,
-0.43884140253067017,
-0.5274838805198669,
-0.352062463760376,
-1.1645532846450806,
-1.5480619668960571,
0.8419402241706848,
1.0975496768951416,
-0.12445073574781418,
0.34999310970306396,
-0.4842933118343353,
-0.25536733865737915,
-0.24653339385986328,
-0.24472978711128... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify - Syntax - Exceptions:
- `TypeError`: Thrown if `typedArray` is not an `Int32Array` or `BigInt64Array`.
- `RangeError`: Thrown if `index` is out of bounds in the `typedArray`. | [
-0.37920162081718445,
-0.4070906341075897,
-0.16679105162620544,
0.44329729676246643,
-0.37176990509033203,
-2.250962734222412,
-0.8564987778663635,
0.6806290745735168,
-0.10659229010343552,
-0.2512339651584625,
-0.45353978872299194,
-0.5072799921035767,
-0.4910128712654114,
-0.14784996211... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify - Examples:
Note that these examples cannot be run directly from the console or an arbitrary web page, because `SharedArrayBuffer` is not defined unless its security requirements are met. | [
0.5299912095069885,
0.6764190793037415,
-1.2650688886642456,
-0.10606072843074799,
-0.9058268070220947,
-0.7665379643440247,
0.6185005903244019,
0.3796064555644989,
0.13047362864017487,
-0.2828359603881836,
0.029543666169047356,
0.04376138746738434,
-0.6287473440170288,
-0.3917019069194793... |
javascript/reference/global_objects/atomics/notify/index.md | JavaScript - Global Objects - Atomics - notify - Examples - Using Atomics.notify():
Given a shared `Int32Array`:
Example:
const sab = new SharedArrayBuffer(1024);
const int32 = new Int32Array(sab);
A reading thread is sleeping and waiting on location 0 because the provided `value` matches what is stored at the prov... | [
0.2995969355106354,
0.11544148623943329,
-0.04599978029727936,
0.16479170322418213,
-0.10433650761842728,
-1.871151089668274,
-0.47257259488105774,
0.24844476580619812,
0.21636347472667694,
-0.027814121916890144,
0.20794197916984558,
-0.75242680311203,
-0.2757507264614105,
-0.1502342969179... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor:
The `Atomics.xor()` static method computes a bitwise XOR with a given value at a given position in the array, and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. | [
-0.06568341702222824,
0.18625862896442413,
-0.8117228746414185,
0.06398651748895645,
-0.037331368774175644,
-1.1743969917297363,
1.3130496740341187,
0.5262410640716553,
0.3161394000053406,
-0.10121782124042511,
-0.2946348786354065,
-0.8972159028053284,
0.12979573011398315,
-0.3685714900493... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Syntax:
Example:
Atomics.xor(typedArray, index, value) | [
0.41375237703323364,
0.10727553814649582,
-0.8321401476860046,
-0.1972224861383438,
-0.8084205389022827,
-1.1999415159225464,
0.5470130443572998,
0.5698878765106201,
0.2124641239643097,
-0.742839515209198,
-0.042594071477651596,
-0.7721641063690186,
-0.40239793062210083,
-0.413980662822723... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Syntax - Parameters:
- `typedArray`: An integer typed array. One of `Int8Array`, `Uint8Array`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `BigInt64Array`, or `BigUint64Array`.
- `index`: The position in the `typedArray` to compute the bitwise XOR.
- `value`:... | [
0.7041304111480713,
-0.3832313120365143,
-1.2810174226760864,
0.11497748643159866,
0.2279980480670929,
-0.5783510804176331,
0.16497986018657684,
0.681929349899292,
0.4781275987625122,
0.022145306691527367,
-0.230412095785141,
-0.026731273159384727,
-0.7836266160011292,
0.08103115856647491,... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Syntax - Return value:
The old value at the given position (`typedArray[index]`). | [
0.369125097990036,
-0.04745982959866524,
-1.1880205869674683,
-0.34060099720954895,
-0.5160899758338928,
-1.5292799472808838,
0.720664381980896,
1.0201256275177002,
-0.11435031145811081,
-0.11411072313785553,
-0.46196454763412476,
0.05224957317113876,
-0.4303891062736511,
0.736785054206848... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Syntax - Exceptions:
- `TypeError`: Thrown if `typedArray` is not one of the allowed integer types.
- `RangeError`: Thrown if `index` is out of bounds in the `typedArray`. | [
0.07243309170007706,
-0.08274255692958832,
-0.4213576912879944,
0.46933117508888245,
-0.21465638279914856,
-1.7680490016937256,
-0.34442758560180664,
0.668103039264679,
-0.18664921820163727,
-0.31730371713638306,
-0.5902959108352661,
-0.24555489420890808,
-0.608880341053009,
-0.68720036745... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Description:
The bitwise XOR operation yields 1, if `a` and `b` are different. The truth table for the XOR operation is:
- `a`: 0, `b`: 0, `a ^ b`: 0
- `a`: 0, `b`: 1, `a ^ b`: 1
- `a`: 1, `b`: 0, `a ^ b`: 1
- `a`: 1, `b`: 1, `a ^ b`: 0
For example, a bitwise XOR of `5 ^... | [
0.16576066613197327,
0.45975542068481445,
-1.9959827661514282,
0.4501253664493561,
0.2667968273162842,
-0.6762735843658447,
0.1397986263036728,
1.1554806232452393,
0.24957601726055145,
0.08899740874767303,
-0.7657569646835327,
-0.685498058795929,
0.12843410670757294,
-0.20089727640151978,
... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Examples:
Note that these examples cannot be run directly from the console or an arbitrary web page, because `SharedArrayBuffer` is not defined unless its security requirements are met. | [
0.6279639601707458,
0.8532634377479553,
-1.6555660963058472,
-0.15967628359794617,
-0.9413398504257202,
-0.1419973373413086,
0.8511806726455688,
0.09687558561563492,
0.12129280716180801,
-0.4926568567752838,
0.21437235176563263,
-0.10573770850896835,
-0.6254065036773682,
-0.711497724056243... |
javascript/reference/global_objects/atomics/xor/index.md | JavaScript - Global Objects - Atomics - xor - Examples - Using Atomics.xor():
Example:
// Create a SharedArrayBuffer with a size in bytes
const sab = new SharedArrayBuffer(1024);
// Create a view and set the value of the 0 index
const ta = new Uint8Array(sab);
ta[0] = 7;
// 7 (0111) XOR 2 (0010) = 5 (0101)
console.l... | [
0.3494158685207367,
0.5619678497314453,
-1.2311410903930664,
0.7618811130523682,
-0.07191459834575653,
-1.0159320831298828,
0.5334230661392212,
0.08110619336366653,
0.4345562160015106,
-0.011224867776036263,
0.0077485861256718636,
-0.3184444010257721,
-0.35316309332847595,
-0.5586642622947... |
javascript/reference/global_objects/isnan/index.md | JavaScript - Global Objects - isNaN:
The `isNaN()` function determines whether a value is `NaN`, first converting the value to a number if necessary. Because coercion inside the `isNaN()` function can be surprising, you may prefer to use `Number.isNaN()`.
Example:
function milliseconds(x) {
if (isNaN(x)) {
ret... | [
-0.8267227411270142,
-0.5644031167030334,
-0.7191245555877686,
-0.15962204337120056,
-1.025219440460205,
-0.9345815777778625,
0.20232363045215607,
-0.15273909270763397,
-0.688082754611969,
0.9068290591239929,
-1.2592440843582153,
-0.3412587344646454,
0.09771917015314102,
-0.539368808269500... |
javascript/reference/global_objects/isnan/index.md | JavaScript - Global Objects - isNaN - Syntax:
Example:
isNaN(value) | [
0.1694640964269638,
0.052387040108442307,
-0.33396080136299133,
-0.5357949733734131,
-1.3916715383529663,
-1.4767526388168335,
1.0474811792373657,
1.2450722455978394,
-0.5495808720588684,
-0.23312143981456757,
-0.9828677177429199,
0.29752567410469055,
-0.028642021119594574,
-0.291906893253... |
javascript/reference/global_objects/isnan/index.md | JavaScript - Global Objects - isNaN - Syntax - Parameters:
- `value`: The value to be tested. | [
0.22225028276443481,
0.13584983348846436,
-0.3650645911693573,
-0.6973456740379333,
-0.9575126767158508,
-1.4363981485366821,
1.0935006141662598,
0.8511436581611633,
-0.40084317326545715,
0.12662190198898315,
-1.3049731254577637,
0.14648999273777008,
-0.13987702131271362,
0.319775462150573... |
javascript/reference/global_objects/isnan/index.md | JavaScript - Global Objects - isNaN - Syntax - Return value:
`true` if the given value is `NaN` after being converted to a number; otherwise, `false`. | [
-0.7550857663154602,
-0.05511805787682533,
-0.16448596119880676,
-0.3245006501674652,
-1.292075514793396,
-1.5715755224227905,
0.901878297328949,
0.7680827379226685,
-1.0557472705841064,
0.44395339488983154,
-1.2638503313064575,
0.08062145113945007,
0.28163501620292664,
0.26119232177734375... |
javascript/reference/global_objects/isnan/index.md | JavaScript - Global Objects - isNaN - Description:
`isNaN()` is a function property of the global object.
For number values, `isNaN()` tests if the number is the value `NaN`. When the argument to the `isNaN()` function is not of type Number, the value is first coerced to a number, and the resulting value is then comp... | [
-0.22072289884090424,
0.08985266089439392,
-0.2569902539253235,
0.2810739576816559,
0.733592689037323,
-0.4020897150039673,
0.7071353197097778,
0.31641894578933716,
-0.5392999053001404,
-0.08408050239086151,
-0.5403169393539429,
-0.05861838161945343,
-0.6847930550575256,
0.4445297122001648... |
javascript/reference/global_objects/isnan/index.md | JavaScript - Global Objects - isNaN - Examples:
Note how `isNaN()` returns `true` for values that are not the value `NaN` but are not numbers either:
Example:
isNaN(NaN); // true
isNaN(undefined); // true
isNaN({}); // true
isNaN(true); // false
isNaN(null); // false
isNaN(37); // false
// Strings
isNaN("37"); // ... | [
-0.809090793132782,
0.1545799821615219,
-0.5224086046218872,
-0.2883472740650177,
-0.7546844482421875,
-1.4551080465316772,
0.30891263484954834,
0.37189796566963196,
-0.9875392317771912,
0.7485197186470032,
-1.045703411102295,
-0.5635591745376587,
0.14021146297454834,
0.1721171885728836,
... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError:
The `RangeError` object indicates an error when a value is not in the set or range of allowed values. | [
-0.9247704148292542,
0.08742059767246246,
-1.3031325340270996,
0.0837695375084877,
-0.5468600392341614,
-2.245140790939331,
-0.7497348785400391,
1.1095643043518066,
-0.47260892391204834,
-0.9228326082229614,
-0.7192912697792053,
-0.07836759090423584,
-0.4892316460609436,
0.0459114164113998... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError - Description:
A `RangeError` is thrown when trying to pass a value as an argument to a function that does not allow a range that includes the value.
This can be encountered when:
- passing a value that is not one of the allowed string values to `String.prototype.normalize()`... | [
-1.1492719650268555,
0.47210800647735596,
-1.0478037595748901,
-0.08597473055124283,
-0.23013973236083984,
-1.044829249382019,
-0.6877149343490601,
0.7093756198883057,
-0.4247642159461975,
-0.6182105541229248,
-0.4119100570678711,
0.08126215636730194,
-0.5490480661392212,
0.192090973258018... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError - Constructor:
- `RangeError()`: Creates a new `RangeError` object. | [
-1.0904886722564697,
0.15678457915782928,
-0.9853726625442505,
-0.05440166965126991,
-0.32001954317092896,
-1.8842692375183105,
-0.705894410610199,
1.4333853721618652,
-0.7452991008758545,
-0.7565789818763733,
-0.7560698390007019,
-0.2676922380924225,
-0.7138566374778748,
0.159521728754043... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError - Instance properties:
Also inherits instance properties from its parent `Error`.
These properties are defined on `RangeError.prototype` and shared by all `RangeError` instances.
- `RangeError.prototype.constructor`: The constructor function that created the instance object. ... | [
-0.585953950881958,
-0.12472543865442276,
-0.7181748747825623,
0.24614495038986206,
-0.41555342078208923,
-1.8608167171478271,
0.057480525225400925,
1.3108118772506714,
-0.09894421696662903,
-0.69035404920578,
-1.0701749324798584,
0.12188705801963806,
-1.4814674854278564,
0.438706070184707... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError - Instance methods:
Inherits instance methods from its parent `Error`. | [
-0.3860059082508087,
-0.25647082924842834,
-0.7806149125099182,
-0.16930441558361053,
-0.5157144069671631,
-2.034733533859253,
0.812014102935791,
1.0384635925292969,
-0.7483263611793518,
-1.303611397743225,
-0.8097906112670898,
0.013581066392362118,
-0.9693865776062012,
0.6898931264877319,... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError - Examples - Using RangeError (for numeric values):
Example:
function check(n) {
if (!(n >= -500 && n <= 500)) {
throw new RangeError("The argument must be between -500 and 500.");
}
}
try {
check(2000);
} catch (error) {
if (error instanceof RangeError) {
// ... | [
-1.0460385084152222,
0.24920451641082764,
-0.9222460389137268,
0.04003844037652016,
-0.1361350119113922,
-1.2920677661895752,
0.00018148210074286908,
0.5936676859855652,
-0.48277950286865234,
-0.3782315254211426,
-0.1580098420381546,
0.35401275753974915,
-0.7529215812683105,
-0.00206833216... |
javascript/reference/global_objects/rangeerror/index.md | JavaScript - Global Objects - RangeError - Examples - Using RangeError (for non-numeric values):
Example:
function check(value) {
if (!["apple", "banana", "carrot"].includes(value)) {
throw new RangeError(
'The argument must be an "apple", "banana", or "carrot".',
);
}
}
try {
check("cabbage");
}... | [
-0.9271708130836487,
-0.2435174137353897,
-0.8124993443489075,
0.6091501116752625,
-0.3351885676383972,
-1.3925533294677734,
0.9613310098648071,
0.37775805592536926,
-1.0496793985366821,
-0.27445894479751587,
-0.04140421748161316,
-0.431694358587265,
-0.48024383187294006,
0.118923433125019... |
javascript/reference/global_objects/rangeerror/rangeerror/index.md | JavaScript - Global Objects - RangeError:
The `RangeError()` constructor creates `RangeError` objects. | [
-0.8252221941947937,
0.41339629888534546,
-0.8463830947875977,
0.08674080669879913,
-0.4604087471961975,
-1.9830402135849,
-0.8938959240913391,
1.1941676139831543,
-0.804906964302063,
-0.5801494121551514,
-0.6564322710037231,
-0.05112126097083092,
-0.9938847422599792,
-0.206837996840477,
... |
javascript/reference/global_objects/rangeerror/rangeerror/index.md | JavaScript - Global Objects - RangeError - Syntax:
Example:
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(... | [
0.2600206136703491,
0.4297970235347748,
-0.6094785928726196,
-0.48475730419158936,
-0.0660601481795311,
-2.2324469089508057,
0.28151702880859375,
1.3334200382232666,
-0.7913075685501099,
-0.22565996646881104,
-0.629313588142395,
-0.4198201298713684,
0.13066013157367706,
0.4617934226989746,... |
javascript/reference/global_objects/rangeerror/rangeerror/index.md | JavaScript - Global Objects - RangeError - Syntax - 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 wit... | [
-0.4221699833869934,
-0.6348264813423157,
-0.9575899839401245,
-0.44317230582237244,
0.0514601469039917,
-1.8260085582733154,
0.2311440259218216,
0.5795742273330688,
-0.10929377377033234,
-0.47601887583732605,
-1.2973780632019043,
0.10620641708374023,
-0.4790501892566681,
0.825147747993469... |
javascript/reference/global_objects/rangeerror/rangeerror/index.md | JavaScript - Global Objects - RangeError - Examples - Using RangeError (for numeric values):
Example:
function check(n) {
if (!(n >= -500 && n <= 500)) {
throw new RangeError("The argument must be between -500 and 500.");
}
}
try {
check(2000);
} catch (error) {
if (error instanceof RangeError) {
// ... | [
-1.0460385084152222,
0.24920451641082764,
-0.9222460389137268,
0.04003844037652016,
-0.1361350119113922,
-1.2920677661895752,
0.00018148210074286908,
0.5936676859855652,
-0.48277950286865234,
-0.3782315254211426,
-0.1580098420381546,
0.35401275753974915,
-0.7529215812683105,
-0.00206833216... |
javascript/reference/global_objects/rangeerror/rangeerror/index.md | JavaScript - Global Objects - RangeError - Examples - Using RangeError (for non-numeric values):
Example:
function check(value) {
if (!["apple", "banana", "carrot"].includes(value)) {
throw new RangeError(
'The argument must be an "apple", "banana", or "carrot".',
);
}
}
try {
check("cabbage");
}... | [
-0.9271708130836487,
-0.2435174137353897,
-0.8124993443489075,
0.6091501116752625,
-0.3351885676383972,
-1.3925533294677734,
0.9613310098648071,
0.37775805592536926,
-1.0496793985366821,
-0.27445894479751587,
-0.04140421748161316,
-0.431694358587265,
-0.48024383187294006,
0.118923433125019... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect:
The `Reflect` namespace object contains static methods for invoking interceptable JavaScript object internal methods. The methods are the same as those of proxy handlers. | [
-1.5839897394180298,
-0.5230207443237305,
-0.7739965915679932,
0.6731839776039124,
0.16544631123542786,
-2.0760014057159424,
0.9647176861763,
-0.07131656259298325,
0.045378804206848145,
0.33702772855758667,
-0.9854851365089417,
0.034539006650447845,
-0.20223991572856903,
0.2380110919475555... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect - Description:
Unlike most global objects, `Reflect` is not a constructor. You cannot use it with the `new` operator or invoke the `Reflect` object as a function. All properties and methods of `Reflect` are static (just like the `Math` object).
The `Reflect` object provides a col... | [
-1.0338486433029175,
0.48806098103523254,
-0.40494298934936523,
1.0217697620391846,
0.4588221311569214,
-1.294777750968933,
-0.16584138572216034,
0.35699766874313354,
-0.11375460028648376,
0.1534024327993393,
-0.7487637400627136,
0.5826897621154785,
-0.7033360600471497,
0.2531907558441162,... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect - Static properties:
- `Reflect[Symbol.toStringTag]`: The initial value of the `[Symbol.toStringTag]` property is the string `"Reflect"`. This property is used in `Object.prototype.toString()`. | [
-1.8715952634811401,
0.37611526250839233,
-0.11299432069063187,
0.13231387734413147,
-0.22120971977710724,
-2.7803759574890137,
0.7181215286254883,
0.5719268918037415,
-0.06071330979466438,
-0.5662671327590942,
-0.6695528030395508,
-0.17690210044384003,
-0.237331360578537,
-0.1089784875512... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect - Static methods:
- `Reflect.apply()`: Calls a `target` function with arguments as specified by the `argumentsList` parameter. See also `Function.prototype.apply()`.
- `Reflect.construct()`: The `new` operator as a function. Equivalent to calling `new target(...argumentsList)`. Al... | [
-1.0016371011734009,
0.38801372051239014,
-0.6123588681221008,
0.8113448023796082,
0.5901312828063965,
-0.6524032950401306,
0.2324398308992386,
-0.07279926538467407,
0.1451181024312973,
-0.1584015190601349,
-0.7884314060211182,
0.39008793234825134,
-0.4186575412750244,
0.528989851474762,
... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect - Examples - Detecting whether an object contains certain properties:
Example:
const duck = {
name: "Maurice",
color: "white",
greeting() {
console.log(`Quaaaack! My name is ${this.name}`);
},
};
Reflect.has(duck, "color");
// true
Reflect.has(duck, "haircut");
// fa... | [
-1.6320399045944214,
-0.6450225114822388,
-0.5171865820884705,
0.2509174942970276,
-0.7104578614234924,
-1.30482816696167,
0.44807061553001404,
-0.20846547186374664,
0.20178139209747314,
0.5495254993438721,
-0.3581235706806183,
0.060490403324365616,
-0.7583277225494385,
-0.2123583853244781... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect - Examples - Returning the object's own keys:
Example:
Reflect.ownKeys(duck);
// [ "name", "color", "greeting" ] | [
-1.1954889297485352,
0.17063423991203308,
-1.0593007802963257,
0.3173210322856903,
-1.1588915586471558,
-1.2062056064605713,
0.7582685351371765,
-0.37681931257247925,
-1.1311556100845337,
-0.028129126876592636,
-0.030650673434138298,
0.7180235385894775,
-0.5810405015945435,
0.1550151109695... |
javascript/reference/global_objects/reflect/index.md | JavaScript - Global Objects - Reflect - Examples - Adding a new property to the object:
Example:
Reflect.set(duck, "eyes", "black");
// returns "true" if successful
// "duck" now contains the property "eyes: 'black'" | [
-1.6159299612045288,
-0.07985571771860123,
-0.48581355810165405,
0.636871337890625,
-0.682605504989624,
-0.994192898273468,
0.501230001449585,
0.36134257912635803,
0.11886700987815857,
-0.18129491806030273,
-0.4080767333507538,
0.22365456819534302,
-0.5120869874954224,
0.39400696754455566,... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf:
The `Reflect.setPrototypeOf()` static method is like `Object.setPrototypeOf()` but returns a `Boolean`. It sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object.
Example:
const object1 = {};
console.log(Reflect.setPrototypeOf(o... | [
-1.207416296005249,
-0.4890928566455841,
-0.82196444272995,
0.9635066390037537,
0.000691148336045444,
-0.8338614106178284,
0.2519575357437134,
0.01577908731997013,
0.5866155624389648,
-0.008721516467630863,
-0.9178643822669983,
0.28805479407310486,
0.6212822198867798,
-0.14848820865154266,... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf - Syntax:
Example:
Reflect.setPrototypeOf(target, prototype) | [
-1.0439937114715576,
-0.1364126205444336,
-0.38447898626327515,
0.27250221371650696,
-0.7617766857147217,
-0.623713493347168,
0.006775413174182177,
0.19918054342269897,
0.40605658292770386,
-0.30510181188583374,
-0.3722955286502838,
0.2952214777469635,
-0.0934821143746376,
0.15262517333030... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf - Syntax - Parameters:
- `target`: The target object of which to set the prototype.
- `prototype`: The object's new prototype (an object or `null`). | [
-0.7762795090675354,
-0.29641959071159363,
-0.7435890436172485,
0.25402867794036865,
-0.18878066539764404,
-1.0374393463134766,
0.26302993297576904,
0.40208059549331665,
0.8894588947296143,
-0.3009835183620453,
-0.7964897751808167,
0.4513483941555023,
-0.2690316140651703,
0.494558602571487... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf - Syntax - Return value:
A `Boolean` indicating whether or not the prototype was successfully set. | [
-0.7112552523612976,
-0.5607373714447021,
-0.39641907811164856,
0.34747689962387085,
-0.36390700936317444,
-0.7521287202835083,
0.5909616947174072,
0.8037412166595459,
0.05428221821784973,
0.08408207446336746,
-0.9248135089874268,
0.8927887082099915,
0.3153565227985382,
0.806799054145813,
... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object or if `prototype` is neither an object nor `null`. | [
-1.3455315828323364,
-0.45336875319480896,
-0.12319450825452805,
0.4096754491329193,
-0.30280691385269165,
-0.999144434928894,
-0.03272426500916481,
0.623299777507782,
-0.398340106010437,
-0.28086230158805847,
-0.422885537147522,
-0.2874060869216919,
-0.3475407361984253,
-0.487520992755889... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf - Description:
`Reflect.setPrototypeOf()` provides the reflective semantic of setting the prototype of an object. At the very low level, setting the prototype returns a boolean (as is the case with the proxy handler). `Object.setPrototypeOf()` provides nearly the ... | [
-1.5066288709640503,
-0.30148106813430786,
-0.9545755982398987,
0.5316946506500244,
-0.13448506593704224,
-0.5200783610343933,
0.22722239792346954,
0.2251950055360794,
0.46900996565818787,
-0.2280079871416092,
-1.0882407426834106,
0.5126011967658997,
0.2889900803565979,
0.6155462265014648,... |
javascript/reference/global_objects/reflect/setprototypeof/index.md | JavaScript - Global Objects - Reflect - setPrototypeOf - Examples - Using Reflect.setPrototypeOf():
Example:
Reflect.setPrototypeOf({}, Object.prototype); // true
// It can change an object's [[Prototype]] to null.
Reflect.setPrototypeOf({}, null); // true
// Returns false if target is not extensible.
Reflect.setPr... | [
-1.5356874465942383,
-0.27348294854164124,
-0.052562177181243896,
0.7736278176307678,
-0.07082454115152359,
-1.6384148597717285,
0.34772631525993347,
0.44405511021614075,
0.4341820180416107,
-0.149616077542305,
-0.9210241436958313,
0.02598176896572113,
0.44902706146240234,
-0.1356957405805... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys:
The `Reflect.ownKeys()` static method returns an array of the `target` object's own property keys.
Example:
const object = {
property1: 42,
property2: 13,
};
const array = [];
console.log(Reflect.ownKeys(object));
// Expected output: Array ["property1", "propert... | [
-0.894608199596405,
-0.010146229527890682,
-1.2032709121704102,
0.06404143571853638,
-0.23766030371189117,
-1.2231392860412598,
0.3684139549732208,
0.22721487283706665,
-0.6112881898880005,
0.30677446722984314,
-0.2914840877056122,
0.9233360886573792,
-0.5334951281547546,
-0.06456220149993... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys - Syntax:
Example:
Reflect.ownKeys(target) | [
-0.6938171982765198,
0.5580587983131409,
-1.0544184446334839,
-0.11984795331954956,
-0.869367241859436,
-1.6344330310821533,
0.7865950465202332,
0.08619517832994461,
-0.7032161951065063,
0.026779258623719215,
-0.054456163197755814,
0.4739709496498108,
-1.0251671075820923,
-0.00128524214960... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys - Syntax - Parameters:
- `target`: The target object from which to get the own keys. | [
0.21026955544948578,
0.3372034728527069,
-1.8715752363204956,
-0.31338468194007874,
-0.486892968416214,
-1.6517746448516846,
0.902487576007843,
0.06300350278615952,
-0.17979420721530914,
0.05555827170610428,
-0.35280755162239075,
0.7365813255310059,
-1.06941556930542,
0.3488127291202545,
... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys - Syntax - Return value:
An `Array` of the `target` object's own property keys, including strings and symbols. For most objects, the array will be in the order of:
- Non-negative integer indexes in increasing numeric order (but as strings)
- Other string keys in the ord... | [
-0.1838473081588745,
0.03766098991036415,
-0.9141547083854675,
0.3594318628311157,
-0.37084224820137024,
-0.8136903643608093,
0.4012989401817322,
0.3595898747444153,
-0.32642391324043274,
0.28797417879104614,
-0.3216816186904907,
0.9972777366638184,
-1.0492403507232666,
0.6026902794837952,... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object. | [
-0.8998159766197205,
-0.08862818032503128,
-0.7826133370399475,
-0.04395630955696106,
-0.5432460308074951,
-0.9146287441253662,
0.23367057740688324,
0.36076074838638306,
-0.6980003118515015,
-0.1618008315563202,
0.11478716880083084,
-0.18055877089500427,
-0.8430498838424683,
-0.57477033138... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys - Description:
`Reflect.ownKeys()` provides the reflective semantic of retrieving all property keys of an object. It is the only way to get all own properties – enumerable and not enumerable, strings and symbols — in one call, without extra filtering logic. For example, ... | [
-0.5202764868736267,
0.2853930592536926,
-0.9126219153404236,
0.5508264899253845,
0.2544827163219452,
-1.167576551437378,
0.875227689743042,
0.4979052245616913,
-0.3843532204627991,
0.34122657775878906,
-0.4890940189361572,
0.47690680623054504,
-0.3436570167541504,
0.08931149542331696,
1... |
javascript/reference/global_objects/reflect/ownkeys/index.md | JavaScript - Global Objects - Reflect - ownKeys - Examples - Using Reflect.ownKeys():
Example:
Reflect.ownKeys({ z: 3, y: 2, x: 1 }); // [ "z", "y", "x" ]
Reflect.ownKeys([]); // ["length"]
const sym = Symbol.for("comet");
const sym2 = Symbol.for("meteor");
const obj = {
[sym]: 0,
str: 0,
773: 0,
0: 0,
[sy... | [
-0.6576460003852844,
0.24067606031894684,
-1.030405044555664,
-0.5113111138343811,
-0.38732022047042847,
-1.3161357641220093,
0.14243020117282867,
-0.504733681678772,
-0.3612779974937439,
0.27624091506004333,
-0.48308098316192627,
0.4960598647594452,
-0.21949510276317596,
0.176261290907859... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty:
The `Reflect.defineProperty()` static method is like `Object.defineProperty()` but returns a `Boolean`.
Example:
const object = {};
if (Reflect.defineProperty(object, "foo", { value: 42 })) {
console.log("foo created!");
// Expected output: "foo created!"
... | [
-1.4591549634933472,
-0.772925078868866,
-0.7596868872642517,
0.5683881044387817,
-0.2922264635562897,
-0.8249559998512268,
0.04218094050884247,
0.38320136070251465,
0.3516084551811218,
0.1566483974456787,
-0.6678375005722046,
0.534463107585907,
0.5027878880500793,
-0.0677342638373375,
0... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Syntax:
Example:
Reflect.defineProperty(target, propertyKey, attributes) | [
-1.8459312915802002,
-0.00706095015630126,
-0.5702273845672607,
0.17547711730003357,
-0.8499552607536316,
-1.4080240726470947,
0.12598586082458496,
-0.040792062878608704,
0.35898420214653015,
-0.23463137447834015,
-0.44602251052856445,
0.48876896500587463,
-0.6987409591674805,
0.2198995798... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Syntax - 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. | [
-0.7178356647491455,
0.07975198328495026,
-0.6362327337265015,
-0.06518951058387756,
-0.328985333442688,
-1.6300114393234253,
0.5476387143135071,
0.1343880593776703,
0.6259868144989014,
-0.11244141310453415,
-0.7935176491737366,
0.878555417060852,
-1.2185693979263306,
0.28341448307037354,
... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Syntax - Return value:
A boolean indicating whether or not the property was successfully defined. | [
-0.8133023977279663,
-0.06722504645586014,
-0.3146354854106903,
0.35051125288009644,
-0.6586192846298218,
-1.2612944841384888,
0.645835816860199,
0.6505259871482849,
0.04791836440563202,
0.044022295624017715,
-1.1147006750106812,
1.049703598022461,
-0.3001801371574402,
0.6972801089286804,
... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Syntax - Exceptions:
- `TypeError`: Thrown if `target` or `attributes` is not an object. | [
-1.2795404195785522,
-0.2816535234451294,
-0.32920530438423157,
0.07818755507469177,
-0.6422230005264282,
-0.9252245426177979,
0.0866238921880722,
0.4282906949520111,
-0.4051376283168793,
-0.29725342988967896,
-0.48785099387168884,
-0.16999945044517517,
-0.5237553119659424,
-0.389257878065... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Description:
`Reflect.defineProperty()` provides the reflective semantic of defining an own property on an object. At the very low level, defining a property returns a boolean (as is the case with the proxy handler). `Object.defineProperty()` provides nearly the... | [
-1.806336522102356,
-0.4376785159111023,
-0.9753726124763489,
0.8676300048828125,
-0.08417604118585587,
-1.4630590677261353,
0.1892448216676712,
-0.07968015968799591,
0.798180341720581,
-0.06156519427895546,
-0.9158453345298767,
0.43277785181999207,
0.18661509454250336,
0.09880854189395905... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Examples - Using Reflect.defineProperty():
Example:
const obj = {};
Reflect.defineProperty(obj, "x", { value: 7 }); // true
console.log(obj.x); // 7 | [
-1.5949703454971313,
0.0927593931555748,
-0.6007440686225891,
0.43490082025527954,
-0.8752428293228149,
-0.7878383994102478,
0.05659693852066994,
-0.18442516028881073,
0.4974730610847473,
-0.4847954213619232,
-0.0812319964170456,
0.38956350088119507,
-0.08360022306442261,
0.324832290410995... |
javascript/reference/global_objects/reflect/defineproperty/index.md | JavaScript - Global Objects - Reflect - defineProperty - Examples - Checking if property definition has been successful:
With `Object.defineProperty()`, which returns an object if successful, or throws a `TypeError` otherwise, you would use a `try...catch` block to catch any error that occurred while defining a proper... | [
-1.1184231042861938,
0.19565415382385254,
-0.5510988235473633,
0.8411192893981934,
-0.08504839986562729,
-0.5603569746017456,
0.5615532398223877,
0.10829378664493561,
-0.16963417828083038,
0.1507231742143631,
-0.7560006976127625,
-0.03769509866833687,
-0.13684017956256866,
0.12426111847162... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set:
The `Reflect.set()` static method is like the property accessor and assignment syntax, but as a function.
Example:
const object = {};
Reflect.set(object, "foo", 42);
console.log(object.foo);
// Expected output: 42
const array = ["duck", "duck", "duck"];
Reflect.set(arra... | [
-1.7612414360046387,
-0.8502168655395508,
-1.4903507232666016,
0.7581327557563782,
-0.24508719146251678,
-1.354966402053833,
0.11473535746335983,
0.8065728545188904,
0.1955246776342392,
0.254619836807251,
-0.1503688544034958,
0.7232336401939392,
0.1041538268327713,
0.31077760457992554,
-... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Syntax:
Example:
Reflect.set(target, propertyKey, value)
Reflect.set(target, propertyKey, value, receiver) | [
-1.700351357460022,
0.0330616794526577,
-1.1757413148880005,
0.5621299743652344,
-0.5938271284103394,
-1.683549404144287,
0.03441077098250389,
0.35122767090797424,
-0.2325328290462494,
-0.7165709137916565,
0.11135701835155487,
0.719470202922821,
-0.724579393863678,
0.21016722917556763,
0... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Syntax - 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`. I... | [
-1.273738980293274,
-0.28789082169532776,
-1.3552026748657227,
0.3931482136249542,
-0.17249795794487,
-1.6112476587295532,
0.7405750751495361,
0.14938712120056152,
0.4467766582965851,
-0.17958040535449982,
-0.6167176365852356,
0.9938924312591553,
-0.9876440763473511,
0.439166396856308,
0... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Syntax - Return value:
A `Boolean` indicating whether or not setting the property was successful. | [
-1.0420928001403809,
-0.26252052187919617,
-1.110025405883789,
0.327881783246994,
-0.48999884724617004,
-1.3433270454406738,
0.6957293748855591,
0.7649866938591003,
-0.04888489469885826,
-0.14433591067790985,
-0.8419771194458008,
1.175856351852417,
-0.042932022362947464,
0.9408533573150635... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object. | [
-1.0206639766693115,
-0.2682902216911316,
-0.8263298869132996,
0.1273346096277237,
-0.5913137793540955,
-1.2531071901321411,
0.2377152293920517,
0.4023037254810333,
-0.6094942092895508,
-0.39921626448631287,
0.0499156229197979,
-0.07688837498426437,
-0.6112942099571228,
-0.3931764364242553... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Description:
`Reflect.set()` provides the reflective semantic of a property access. That is, `Reflect.set(target, propertyKey, value, receiver)` is semantically equivalent to:
Example:
target[propertyKey] = value;
Note that in a normal property access, `target` and `rec... | [
-1.5865886211395264,
0.06696163862943649,
-1.5546386241912842,
0.564985990524292,
-0.27686038613319397,
-2.023493766784668,
0.2688049077987671,
0.27168428897857666,
0.11864174902439117,
-0.2780243754386902,
-0.13202661275863647,
0.7207943797111511,
-0.8303678035736084,
0.08907127380371094,... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Examples - Using Reflect.set():
Example:
// Object
const obj = {};
Reflect.set(obj, "prop", "value"); // true
obj.prop; // "value"
// Array
const arr = ["duck", "duck", "duck"];
Reflect.set(arr, 2, "goose"); // true
arr[2]; // "goose"
// It can truncate an array.
Reflec... | [
-1.5614455938339233,
0.07879968732595444,
-0.8778677582740784,
0.5574325919151306,
-0.6299335956573486,
-1.4229048490524292,
0.07545652985572815,
0.019357098266482353,
-0.015997599810361862,
0.1192527785897255,
-0.328039288520813,
0.6682003140449524,
-0.2673850655555725,
0.0087735988199710... |
javascript/reference/global_objects/reflect/set/index.md | JavaScript - Global Objects - Reflect - set - Examples - Different target and receiver:
When the `target` and `receiver` are different, `Reflect.set` will use the property descriptor of `target` (to find the setter or determine if the property is writable), but set the property on `receiver`.
Example:
const target =... | [
-1.744463562965393,
-0.3377845585346222,
-0.9386574029922485,
0.3789311945438385,
-0.14081066846847534,
-1.7612532377243042,
-0.518048107624054,
-0.014793704263865948,
0.9286734461784363,
-0.12610164284706116,
-0.22961857914924622,
0.2550230324268341,
-0.7717847228050232,
0.095804639160633... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has:
The `Reflect.has()` static method is like the `in` operator, but as a function.
Example:
const object = {
property1: 42,
};
console.log(Reflect.has(object, "property1"));
// Expected output: true
console.log(Reflect.has(object, "property2"));
// Expected output: false... | [
-1.109040379524231,
-0.47495824098587036,
-1.0603835582733154,
0.9302530288696289,
0.27484142780303955,
-1.801370620727539,
0.17971302568912506,
0.36498263478279114,
-0.2412051111459732,
0.08364123851060867,
-0.5235183835029602,
0.01210531685501337,
0.08166569471359253,
-0.2382270991802215... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has - Syntax:
Example:
Reflect.has(target, propertyKey) | [
-1.3103951215744019,
0.045850932598114014,
-0.7851334810256958,
0.25931882858276367,
-0.7383885979652405,
-1.6461130380630493,
0.6238988637924194,
-0.08210279792547226,
-0.9687978625297546,
-0.06277167052030563,
-0.30554768443107605,
0.2735995352268219,
-0.8084908723831177,
0.1418950557708... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has - Syntax - Parameters:
- `target`: The target object in which to look for the property.
- `propertyKey`: The name of the property to check. | [
-0.7703821063041687,
0.00971947517246008,
-1.044983983039856,
-0.14571543037891388,
-0.23513880372047424,
-1.5882452726364136,
0.8569086194038391,
-0.356466680765152,
-0.17673535645008087,
-0.04808519780635834,
-0.9424509406089783,
0.7758592963218689,
-1.2386226654052734,
0.376809060573577... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has - Syntax - Return value:
A `Boolean` indicating whether or not the `target` has the property. | [
-1.2759196758270264,
-0.49429136514663696,
-0.5726858973503113,
0.0097619304433465,
-0.696292519569397,
-1.3611634969711304,
0.928539514541626,
0.34380006790161133,
-0.6084548830986023,
-0.09885342419147491,
-0.9204903244972229,
0.6541941165924072,
-0.06628310680389404,
0.5108532309532166,... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object. | [
-0.9047800898551941,
-0.36943477392196655,
-0.6054681539535522,
0.14007915556430817,
-0.6303308010101318,
-1.2010688781738281,
0.48052123188972473,
0.19890889525413513,
-0.8225651383399963,
-0.21695785224437714,
-0.10081931948661804,
-0.1852276623249054,
-0.6676091551780701,
-0.31587934494... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has - Description:
`Reflect.has()` provides the reflective semantic of checking if a property is in an object. That is, `Reflect.has(target, propertyKey)` is semantically equivalent to:
Example:
propertyKey in target;
`Reflect.has()` invokes the `[[HasProperty]]` object inter... | [
-1.3956047296524048,
-0.1533135622739792,
-0.8421674370765686,
0.3478815257549286,
-0.022672679275274277,
-1.9625189304351807,
0.9951741099357605,
-0.15130677819252014,
-0.5338347554206848,
0.12174248695373535,
-0.5279483795166016,
-0.030773933976888657,
-0.6761066913604736,
0.128071427345... |
javascript/reference/global_objects/reflect/has/index.md | JavaScript - Global Objects - Reflect - has - Examples - Using Reflect.has():
Example:
Reflect.has({ x: 0 }, "x"); // true
Reflect.has({ x: 0 }, "y"); // false
// returns true for properties in the prototype chain
Reflect.has({ x: 0 }, "toString");
// Proxy with .has() handler method
obj = new Proxy(
{},
{
... | [
-0.8055376410484314,
0.16945575177669525,
-1.1828558444976807,
0.33648666739463806,
-0.4574703574180603,
-1.5485069751739502,
0.6094701290130615,
0.10676831007003784,
-0.6860321164131165,
0.14838728308677673,
-0.8364660143852234,
0.22129438817501068,
-0.15934738516807556,
0.268611639738082... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf:
The `Reflect.getPrototypeOf()` static method is like `Object.getPrototypeOf()`. It returns the prototype of the specified object.
Example:
const object = {
foo: 42,
};
const proto = Reflect.getPrototypeOf(object);
console.log(proto);
// Expected output: Obj... | [
-1.0718504190444946,
-0.8304585814476013,
-0.5397704839706421,
-0.006484499201178551,
-0.27545836567878723,
-1.2571293115615845,
-0.20235474407672882,
0.1387963742017746,
0.09070383012294769,
0.1960253268480301,
-0.5106805562973022,
0.2187468409538269,
0.1482343077659607,
0.240679919719696... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Syntax:
Example:
Reflect.getPrototypeOf(target) | [
-0.979019820690155,
0.04342423006892204,
-0.3566240966320038,
-0.3292309641838074,
-0.7556915283203125,
-1.1003626585006714,
0.15399691462516785,
-0.08747856318950653,
-0.038166336715221405,
-0.4214690327644348,
-0.27314096689224243,
0.25071465969085693,
-0.3816279470920563,
0.016622042283... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Syntax - Parameters:
- `target`: The target object of which to get the prototype. | [
-0.4399113059043884,
0.03818875551223755,
-0.7950668931007385,
-0.4587244689464569,
-0.46567484736442566,
-1.265580177307129,
0.2136751264333725,
0.14978228509426117,
0.4113622307777405,
-0.12183193117380142,
-0.6363407969474792,
0.4573000371456146,
-0.7139474749565125,
0.4619818329811096,... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Syntax - Return value:
The prototype of the given object, which may be an object or `null`. | [
-0.7726672887802124,
-0.1687973439693451,
-0.04086260125041008,
-0.06590728461742401,
-0.3869853913784027,
-1.0366692543029785,
0.34545332193374634,
0.8708248734474182,
0.43781742453575134,
-0.09975248575210571,
-0.8263768553733826,
0.7312595844268799,
-0.4981135129928589,
0.54834806919097... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object. | [
-1.151950716972351,
-0.3055945634841919,
-0.2224774807691574,
-0.06680063903331757,
-0.5681236386299133,
-0.6343247890472412,
-0.01659562811255455,
0.44417208433151245,
-0.5529074668884277,
-0.33451104164123535,
-0.14006735384464264,
-0.1814585030078888,
-0.5472989082336426,
-0.48706868290... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Description:
`Reflect.getPrototypeOf()` provides the reflective semantic of retrieving the prototype of an object. The only difference with `Object.getPrototypeOf()` is how non-object targets are handled. `Reflect.getPrototypeOf()` throws a `TypeError` if the ta... | [
-0.9499715566635132,
-0.6747360229492188,
-0.6427373886108398,
-0.0817703902721405,
-0.4020562171936035,
-1.2223159074783325,
-0.033517852425575256,
-0.012355324812233448,
0.0926034152507782,
-0.09911640733480453,
-0.9029621481895447,
-0.15951742231845856,
-0.6618263721466064,
0.2616213560... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Examples - Using Reflect.getPrototypeOf():
Example:
Reflect.getPrototypeOf({}); // Object.prototype
Reflect.getPrototypeOf(Object.prototype); // null
Reflect.getPrototypeOf(Object.create(null)); // null | [
-1.0288231372833252,
-0.04642461612820625,
-0.02954068034887314,
0.15618954598903656,
-0.39119237661361694,
-1.1774263381958008,
0.20836980640888214,
0.13456663489341736,
-0.1705234795808792,
-0.34540441632270813,
-0.6554008722305298,
0.044441577047109604,
0.09221850335597992,
-0.009198867... |
javascript/reference/global_objects/reflect/getprototypeof/index.md | JavaScript - Global Objects - Reflect - getPrototypeOf - Examples - Difference with Object.getPrototypeOf():
Example:
// Same result for Objects
Object.getPrototypeOf({}); // Object.prototype
Reflect.getPrototypeOf({}); // Object.prototype
// Both throw in ES5 for non-Objects
Object.getPrototypeOf("foo"); // Throws ... | [
-0.6221243739128113,
-0.7943552136421204,
-0.36741510033607483,
0.08539249747991562,
0.03252837434411049,
-2.0164926052093506,
-0.5147042274475098,
0.48865821957588196,
0.06504101306200027,
-0.09457159787416458,
-0.5926523208618164,
-0.3293432891368866,
-0.6359395384788513,
0.1769636571407... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions:
The `Reflect.preventExtensions()` static method is like `Object.preventExtensions()`. It prevents new properties from ever being added to an object (i.e., prevents future extensions to the object).
Example:
const object = {};
console.log(Reflect.isExtensibl... | [
-1.446843147277832,
-0.41791439056396484,
-0.9042523503303528,
0.5426450371742249,
-0.5215774774551392,
-2.3165385723114014,
0.5177631378173828,
1.0526423454284668,
0.035356082022190094,
0.33511844277381897,
-1.1720587015151978,
0.26311376690864563,
-0.6764799356460571,
-0.0754200518131256... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Syntax:
Example:
Reflect.preventExtensions(target) | [
-1.046627402305603,
0.31085100769996643,
-0.5640040636062622,
-0.27606725692749023,
-1.4039734601974487,
-2.0459303855895996,
0.5346192121505737,
0.6927497386932373,
-0.03371138498187065,
-0.07732921838760376,
-0.5020732879638672,
0.09830465167760849,
-1.2475357055664062,
-0.31905144453048... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Syntax - Parameters:
- `target`: The target object on which to prevent extensions. | [
-0.5162340998649597,
0.22030605375766754,
-1.0389459133148193,
-0.1439349502325058,
-0.9065119624137878,
-2.2804763317108154,
0.5397869944572449,
0.8891853094100952,
0.3480982184410095,
0.04865116998553276,
-1.1927433013916016,
0.41802728176116943,
-1.2464103698730469,
0.003068129532039165... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Syntax - Return value:
A `Boolean` indicating whether or not the target was successfully set to prevent extensions. | [
-0.9217323660850525,
-0.05560930818319321,
-0.7761139869689941,
-0.13368427753448486,
-1.073529839515686,
-2.014997720718384,
0.9357838034629822,
1.281050205230713,
0.06663088500499725,
0.2384394109249115,
-1.1578998565673828,
0.8478535413742065,
-0.6497229337692261,
0.5557128190994263,
... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object. | [
-1.0246165990829468,
-0.10568377375602722,
-0.5093184113502502,
-0.062023263424634933,
-0.9187331199645996,
-1.3930027484893799,
0.23861202597618103,
0.64765465259552,
-0.38349851965904236,
-0.23516054451465607,
-0.24082264304161072,
-0.4020167291164398,
-0.9236121773719788,
-0.80436450242... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Description:
`Reflect.preventExtensions()` provides the reflective semantic of preventing extensions of an object. The differences with `Object.preventExtensions()` are:
- `Reflect.preventExtensions()` throws a `TypeError` if the target is not an object, whi... | [
-1.3939656019210815,
-0.2576237618923187,
-0.8784199953079224,
-0.03727889060974121,
-0.703010082244873,
-2.16809344291687,
0.3646377623081207,
0.4928550720214844,
0.19029667973518372,
0.12165055423974991,
-0.9624496102333069,
0.36651575565338135,
-1.143846869468689,
-0.20845969021320343,
... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Examples - Using Reflect.preventExtensions():
See also `Object.preventExtensions()`.
Example:
// Objects are extensible by default.
const empty = {};
Reflect.isExtensible(empty); // true
// … but that can be changed.
Reflect.preventExtensions(empty);
Refle... | [
-1.4292848110198975,
0.15382535755634308,
-0.17668607831001282,
0.2969070374965668,
-0.6253299117088318,
-2.6804721355438232,
1.0034737586975098,
0.7821259498596191,
0.12469447404146194,
-0.004303049761801958,
-1.2023591995239258,
0.2570328414440155,
-0.8621576428413391,
-0.183963045477867... |
javascript/reference/global_objects/reflect/preventextensions/index.md | JavaScript - Global Objects - Reflect - preventExtensions - Examples - Difference with Object.preventExtensions():
If the `target` argument to this method is not an object (a primitive), then it will cause a `TypeError`. With `Object.preventExtensions()`, a non-object `target` will be returned as-is without any errors... | [
-1.2681630849838257,
-0.22493410110473633,
-0.6406781673431396,
-0.3939995765686035,
-0.7455569505691528,
-1.7637138366699219,
0.6913257241249084,
0.6111584901809692,
0.008794578723609447,
0.08000299334526062,
-0.7262728810310364,
-0.3604082763195038,
-1.0265318155288696,
-0.85498273372650... |
javascript/reference/global_objects/reflect/get/index.md | JavaScript - Global Objects - Reflect - get:
The `Reflect.get()` static method is like the property accessor syntax, but as a function.
Example:
const object = {
x: 1,
y: 2,
};
console.log(Reflect.get(object, "x"));
// Expected output: 1
const array = ["zero", "one"];
console.log(Reflect.get(array, 1));
// Ex... | [
-1.4256560802459717,
-0.5021597743034363,
-1.551903247833252,
0.4395824074745178,
-0.061910245567560196,
-1.6560670137405396,
0.0005454951897263527,
0.793951690196991,
0.19875317811965942,
0.197632297873497,
-0.3679332137107849,
-0.046889081597328186,
-0.4339023530483246,
0.157471179962158... |
javascript/reference/global_objects/reflect/get/index.md | JavaScript - Global Objects - Reflect - get - Syntax:
Example:
Reflect.get(target, propertyKey)
Reflect.get(target, propertyKey, receiver) | [
-1.4904289245605469,
0.0981675386428833,
-1.0983728170394897,
0.01917158253490925,
-0.7503722906112671,
-1.9890356063842773,
0.032048821449279785,
0.09126020967960358,
-0.4461056590080261,
-0.387881338596344,
0.00709440978243947,
0.37717726826667786,
-1.158037781715393,
0.3247811198234558,... |
javascript/reference/global_objects/reflect/get/index.md | JavaScript - Global Objects - Reflect - get - Syntax - 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. Defaults to `target`. | [
-0.8140355348587036,
0.06334738433361053,
-1.4505367279052734,
-0.10109875351190567,
-0.4465409815311432,
-1.9592901468276978,
0.39410099387168884,
0.04872189834713936,
0.11240018159151077,
0.018633108586072922,
-0.7616549134254456,
0.8126882314682007,
-1.6232824325561523,
0.44722396135330... |
javascript/reference/global_objects/reflect/get/index.md | JavaScript - Global Objects - Reflect - get - Syntax - Return value:
The value of the property. | [
-0.6015943884849548,
0.30304762721061707,
-0.6985803246498108,
0.11825135350227356,
-0.7501858472824097,
-1.6358253955841064,
0.4264028072357178,
0.6663572788238525,
0.12526331841945648,
-0.3089791536331177,
-0.6209002733230591,
1.091457724571228,
-1.1265805959701538,
1.075837254524231,
... |
javascript/reference/global_objects/reflect/get/index.md | JavaScript - Global Objects - Reflect - get - Syntax - Exceptions:
- `TypeError`: Thrown if `target` is not an object. | [
-0.9067029356956482,
-0.29686790704727173,
-0.6780918836593628,
-0.14469969272613525,
-0.7507327198982239,
-1.3712536096572876,
0.22329814732074738,
0.2680012881755829,
-0.7118364572525024,
-0.3162752687931061,
0.11209667474031448,
-0.22044748067855835,
-0.7950089573860168,
-0.217791646718... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.