file
stringlengths
16
94
text
stringlengths
32
24.4k
vector
list
javascript/reference/global_objects/typedarray/every/index.md
JavaScript - Global Objects - TypedArray - every - Description: See `Array.prototype.every()` for more details. This method is not generic and can only be called on typed array instances.
[ -0.03946661949157715, -0.2733791768550873, -0.18939201533794403, 0.3070308268070221, -0.4965420961380005, -1.0764156579971313, 0.47599998116493225, 0.6440576910972595, -0.15333662927150726, -0.11090654134750366, -0.42930904030799866, 0.18701805174350739, 0.21574155986309052, -0.40429648756...
javascript/reference/global_objects/typedarray/every/index.md
JavaScript - Global Objects - TypedArray - every - Examples - Testing size of all typed array elements: The following example tests whether all elements in the typed array are 10 or bigger. Example: function isBigEnough(element, index, array) { return element >= 10; } new Uint8Array([12, 5, 8, 130, 44]).every(isBi...
[ 0.27434515953063965, -0.6664244532585144, -1.1007329225540161, -0.09093985706567764, -0.7092879414558411, -1.3420798778533936, 0.5737429261207581, 0.18927815556526184, -0.8118833899497986, -0.05955034866929054, -0.13962586224079132, 0.0021669415291398764, -0.6627320647239685, -0.3450419008...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries: The `entries()` method of `TypedArray` instances returns a new array iterator object that contains the key/value pairs for each index in the typed array. This method has the same algorithm as `Array.prototype.entries()`. Example: const uint8 = new Uint8Array([10, 2...
[ -0.02388022467494011, -1.116363763809204, -1.157680869102478, 0.728308916091919, 0.09042385220527649, -0.5312820076942444, -0.49974754452705383, 0.7618083357810974, -0.3685551583766937, 0.6890313625335693, 0.007388277444988489, 0.6916722655296326, 0.5715979933738708, 0.29905569553375244, ...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries - Syntax: Example: entries()
[ 0.8530563712120056, -0.5040757060050964, -1.1753647327423096, 0.21646742522716522, -0.6539914011955261, -1.4489020109176636, 0.4055308699607849, 1.0545380115509033, -0.24715375900268555, -0.2157779335975647, -0.12163249403238297, 0.05237345024943352, -0.07271161675453186, -0.01175158377736...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries - Syntax - Parameters: None.
[ 0.5638265609741211, 0.09436139464378357, -1.1124634742736816, -0.5167499780654907, -0.3255779445171356, -0.8207334876060486, 0.563143789768219, 1.3579870462417603, -0.4300871193408966, -0.40124136209487915, -0.6192295551300049, -0.8347623944282532, 0.007557960227131844, 0.01330406218767166...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries - Syntax - Return value: A new iterable iterator object.
[ 0.24435590207576752, -0.3166855573654175, -0.8859929442405701, -0.1401883214712143, -0.3419990837574005, -1.0794503688812256, -0.037661146372556686, 1.523155927658081, -0.049558211117982864, 0.2639027535915375, -0.5186121463775635, 0.11310720443725586, -0.21355180442333221, 0.8092679381370...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries - Description: See `Array.prototype.entries()` for more details. This method is not generic and can only be called on typed array instances.
[ 0.2772423028945923, -0.1875448375940323, -0.5876091122627258, 0.2796775996685028, -0.3072187900543213, -1.082090973854065, 0.30433112382888794, 0.7862389087677002, -0.23442134261131287, 0.19839666783809662, -0.6614695191383362, 0.014629068784415722, 0.3975811004638672, -0.23736414313316345...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries - Examples - Iteration using for...of loop: Example: const array = new Uint8Array([10, 20, 30, 40, 50]); const arrayEntries = arr.entries(); for (const element of arrayEntries) { console.log(element); }
[ 0.3774658739566803, -0.5641049742698669, -0.5319491028785706, 0.9420421123504639, -0.24573512375354767, -1.3782113790512085, -0.03291697800159454, 0.22654086351394653, -0.5305566787719727, 0.3576028347015381, 0.5232373476028442, 0.47563061118125916, -0.34243103861808777, 0.3772575259208679...
javascript/reference/global_objects/typedarray/entries/index.md
JavaScript - Global Objects - TypedArray - entries - Examples - Alternative iteration: Example: const array = new Uint8Array([10, 20, 30, 40, 50]); const arrayEntries = arr.entries(); console.log(arrayEntries.next().value); // [0, 10] console.log(arrayEntries.next().value); // [1, 20] console.log(arrayEntries.next()...
[ 0.4479354918003082, -0.6808463931083679, -0.687390923500061, 0.38759779930114746, -0.16469542682170868, -1.3007599115371704, -0.33086106181144714, 0.27150943875312805, -0.2742677927017212, 0.43528223037719727, 0.44164788722991943, 0.5942043662071228, -0.04175527021288872, 0.050985917448997...
javascript/reference/global_objects/typedarray/foreach/index.md
JavaScript - Global Objects - TypedArray - forEach: The `forEach()` method of `TypedArray` instances executes a provided function once for each typed array element. This method has the same algorithm as `Array.prototype.forEach()`. Example: const uint8 = new Uint8Array([10, 20, 30]); uint8.forEach((element) => cons...
[ 0.23822985589504242, -1.1528429985046387, -1.2223917245864868, 0.07092541456222534, -0.05604282766580582, -0.8229370713233948, 0.015337135642766953, 1.1298513412475586, -0.9941253662109375, 0.5647386908531189, 0.04251624271273613, 0.46928200125694275, 0.1632402390241623, 0.0287811122834682...
javascript/reference/global_objects/typedarray/foreach/index.md
JavaScript - Global Objects - TypedArray - forEach - Syntax: Example: forEach(callbackFn) forEach(callbackFn, thisArg)
[ 0.2558553218841553, 0.2344011515378952, -0.17099162936210632, -0.5822281241416931, -0.8445671200752258, -2.0299954414367676, 0.9203411340713501, 0.9383260011672974, -0.8436933159828186, -0.07524879276752472, -0.40703219175338745, 0.47847089171409607, -0.6671950817108154, 0.5610547065734863...
javascript/reference/global_objects/typedarray/foreach/index.md
JavaScript - Global Objects - TypedArray - forEach - Syntax - Parameters: - `callbackFn`: A function to execute for each element in the typed array. Its return value is discarded. The function is called with the following arguments: - `element`: The current element being processed in the typed array. - `index`: Th...
[ 0.006599428132176399, -0.25483840703964233, -1.0454045534133911, -0.05335567519068718, -0.08382336795330048, -1.7680509090423584, 1.0994185209274292, 0.5409740805625916, -0.844900906085968, 0.49318867921829224, -0.7382469177246094, 0.564474880695343, -1.1314873695373535, 1.3416963815689087...
javascript/reference/global_objects/typedarray/foreach/index.md
JavaScript - Global Objects - TypedArray - forEach - Syntax - Return value: None (`undefined`).
[ -0.04504162445664406, 0.06208266317844391, -0.6214507818222046, -0.937938928604126, -0.6396711468696594, -1.0621683597564697, 1.0625969171524048, 1.2292226552963257, -0.8358307480812073, 0.025690153241157532, 0.050462499260902405, 0.21677690744400024, -0.014192868024110794, 0.0524390153586...
javascript/reference/global_objects/typedarray/foreach/index.md
JavaScript - Global Objects - TypedArray - forEach - Description: See `Array.prototype.forEach()` for more details. This method is not generic and can only be called on typed array instances.
[ 0.24821987748146057, -0.17328326404094696, -0.36178073287010193, -0.19168008863925934, -0.13522124290466309, -1.3210599422454834, 0.43844887614250183, 1.0162118673324585, -0.48012542724609375, 0.11653892695903778, -0.5543312430381775, 0.40923184156417847, 0.13752448558807373, -0.1715802848...
javascript/reference/global_objects/typedarray/foreach/index.md
JavaScript - Global Objects - TypedArray - forEach - Examples - Logging the contents of a typed array: The following code logs a line for each element in a typed array: Example: function logArrayElements(element, index, array) { console.log(`a[${index}] = ${element}`); } new Uint8Array([0, 1, 2, 3]).forEach(logAr...
[ 0.5420118570327759, -0.4340512752532959, -1.0086334943771362, -0.07310541719198227, 0.041671160608530045, -1.0054529905319214, -0.16424398124217987, 0.7132558822631836, -0.73776775598526, -0.24654562771320343, 0.3866713345050812, 0.4510553181171417, -0.08646102994680405, -0.459667295217514...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet: A `WeakSet` is a collection of garbage-collectable values, including objects and non-registered symbols. A value in the `WeakSet` may only occur once. It is unique in the `WeakSet`'s collection.
[ -0.36850816011428833, -0.16366362571716309, -0.9457049369812012, 0.2023889720439911, 0.08142945915460587, -2.908935546875, 0.6900118589401245, 1.3228349685668945, -0.2169671356678009, 0.5546289682388306, -1.0108156204223633, 0.5854315757751465, 0.09632182121276855, 0.17987416684627533, 0...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Description: Values of WeakSets must be garbage-collectable. Most `primitive data types` can be arbitrarily created and don't have a lifetime, so they cannot be stored. Objects and non-registered symbols can be stored because they are garbage-collectable. The main differences t...
[ -0.12361976504325867, -0.22869184613227844, -1.1865544319152832, 0.34203359484672546, 0.19791613519191742, -3.077667474746704, 0.674802839756012, 1.729979395866394, 0.2169799953699112, 0.6358967423439026, -0.8361389636993408, 0.4230598211288452, -0.16421183943748474, 0.14847733080387115, ...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Description - Key equality: Like regular `Set`, value equality is based on the SameValueZero algorithm, which is the same as the `===` operator because `WeakSet` can only hold object and symbol values. This means that for object values, equality is based on object identity. They...
[ -0.3015318512916565, -0.2331102341413498, -1.2486801147460938, 0.43773332238197327, 0.2801103889942169, -1.8580005168914795, 1.16963791847229, 1.7636831998825073, -0.3301774263381958, 0.033690180629491806, -1.1052136421203613, -0.15510086715221405, 0.5047724843025208, 0.41352909803390503, ...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Constructor: - `WeakSet()`: Creates a new `WeakSet` object.
[ -1.007498860359192, 0.02097802236676216, -0.8554542660713196, -0.15507014095783234, 0.13076987862586975, -2.357475996017456, 0.472348690032959, 1.7513359785079956, -0.3810426592826843, 0.19892385601997375, -1.1466556787490845, 0.057529840618371964, -0.13414548337459564, 0.42482998967170715...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Instance properties: These properties are defined on `WeakSet.prototype` and shared by all `WeakSet` instances. - `WeakSet.prototype.constructor`: The constructor function that created the instance object. For `WeakSet` instances, the initial value is the `WeakSet` constructor....
[ -0.7026470899581909, -0.2289249449968338, -0.589225172996521, 0.3604353666305542, 0.38716453313827515, -2.6380457878112793, 0.7596222758293152, 1.366524577140808, 0.38720977306365967, 0.17043490707874298, -1.4276353120803833, 0.49125155806541443, -0.16849873960018158, 0.05570788308978081, ...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Instance methods: - `WeakSet.prototype.add()`: Inserts the specified value into this set, if it is not already present. - `WeakSet.prototype.delete()`: Removes the specified value from this set, if it is in the set. - `WeakSet.prototype.has()`: Returns a boolean indicating wheth...
[ -1.0081559419631958, -0.6021245718002319, -0.03863810747861862, 0.5871236324310303, 0.05400504171848297, -1.7990305423736572, 1.7825427055358887, 1.1074800491333008, 0.025252453982830048, 0.07430709153413773, -1.6452782154083252, 0.44217008352279663, 0.5061228275299072, -0.1477310061454773...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Examples - Using the WeakSet object: Example: const ws = new WeakSet(); const foo = {}; const bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); // removes foo from the set ws.has(foo); // false, foo has been removed ws.has(bar); //...
[ 0.024588212370872498, 0.5836142897605896, -1.260974645614624, 0.5454177856445312, -0.2034284621477127, -2.9138386249542236, 1.1865876913070679, 1.0311344861984253, 0.32408350706100464, 0.9026716947555542, -1.172996997833252, 0.40502044558525085, -0.25631558895111084, 0.3915744721889496, ...
javascript/reference/global_objects/weakset/index.md
JavaScript - Global Objects - WeakSet - Examples - Detecting circular references: Functions that call themselves recursively need a way of guarding against circular data structures by tracking which objects have already been processed. `WeakSet`s are ideal for this purpose: Example: // Execute a callback on everyth...
[ -0.7361578941345215, 0.2889949381351471, -1.0700575113296509, 1.0457501411437988, 0.800564169883728, -1.251186728477478, 0.6517511606216431, 0.7672587633132935, -0.1642809361219406, 0.6233124136924744, -1.1327966451644897, 0.21589608490467072, -0.19511857628822327, 0.6894907355308533, 0....
javascript/reference/global_objects/weakset/has/index.md
JavaScript - Global Objects - WeakSet - has: The `has()` method of `WeakSet` instances returns a boolean indicating whether the specified value exists in this `WeakSet` or not. Example: const weakset = new WeakSet(); const object1 = {}; const object2 = {}; weakset.add(object1); console.log(weakset.has(object1)); /...
[ -0.5942573547363281, -0.6249920129776001, -1.071033000946045, 0.46133753657341003, -0.03880239650607109, -2.4248199462890625, 1.4782917499542236, 1.170430302619934, -0.6124342083930969, 0.3287482261657715, -1.0458581447601318, 0.10519008338451385, 0.5723903775215149, 0.06117158383131027, ...
javascript/reference/global_objects/weakset/has/index.md
JavaScript - Global Objects - WeakSet - has - Syntax: Example: has(value)
[ 0.5675249099731445, 0.1554451286792755, -0.9175037145614624, -0.507036566734314, -0.5826505422592163, -2.3870577812194824, 1.5860974788665771, 1.3283780813217163, -0.7755425572395325, 0.23791249096393585, -0.8915049433708191, 0.6438356637954712, -0.04257199168205261, 0.17578913271427155, ...
javascript/reference/global_objects/weakset/has/index.md
JavaScript - Global Objects - WeakSet - has - Syntax - Parameters: - `value`: The value to test for presence in the `WeakSet` object. Objects are compared by reference, not by value.
[ 0.08440574258565903, -0.2508232891559601, -0.6980875730514526, -0.31085842847824097, 0.06263720989227295, -2.4406800270080566, 1.5215742588043213, 1.167352318763733, 0.13930420577526093, 0.07276657968759537, -1.4519014358520508, 0.6971760392189026, -0.1738964319229126, 0.447206974029541, ...
javascript/reference/global_objects/weakset/has/index.md
JavaScript - Global Objects - WeakSet - has - Syntax - Return value: Returns `true` if the specified value exists in the `WeakSet` object; otherwise `false`. Always returns `false` if `value` is not an object or a non-registered symbol.
[ -0.6451697945594788, 0.09513220936059952, -0.6233567595481873, 0.055523086339235306, -0.5022863745689392, -2.4620444774627686, 1.5980870723724365, 1.322328805923462, -0.46766799688339233, 0.3732922077178955, -1.059093952178955, 0.7065731883049011, 0.1663225293159485, 0.6731203198432922, ...
javascript/reference/global_objects/weakset/has/index.md
JavaScript - Global Objects - WeakSet - has - Examples - Using has(): Example: const ws = new WeakSet(); const obj = {}; ws.add(window); ws.has(window); // returns true ws.has(obj); // returns false // Storing a non-registered symbol const sym = Symbol("foo"); ws.add(sym); ws.add(Symbol.iterator);
[ -0.24073512852191925, 0.3332418203353882, -0.7057089805603027, 0.330155611038208, -0.30338332056999207, -2.467043399810791, 1.0505623817443848, 0.9230607151985168, -0.1609722226858139, 0.7910214066505432, -0.9708884358406067, 0.505539059638977, 0.10933389514684677, 0.1073383241891861, 0....
javascript/reference/global_objects/weakset/add/index.md
JavaScript - Global Objects - WeakSet - add: The `add()` method of `WeakSet` instances inserts the specified value into this set, if it is not already present. Example: const weakset = new WeakSet(); const object = {}; weakset.add(object); console.log(weakset.has(object)); // Expected output: true try { weakset....
[ -0.4681551456451416, -0.09063897281885147, -1.2393759489059448, 0.2038741409778595, -0.06340941041707993, -1.7417538166046143, 1.2819290161132812, 0.9994553327560425, -0.368721604347229, 0.07679862529039383, -0.5475603938102722, 0.3376801609992981, -0.11240029335021973, 0.11348659545183182...
javascript/reference/global_objects/weakset/add/index.md
JavaScript - Global Objects - WeakSet - add - Syntax: Example: add(value)
[ 0.3563085198402405, 0.12974071502685547, -0.5877461433410645, -0.4542907178401947, -0.7428590655326843, -1.9376544952392578, 1.8929390907287598, 1.4766209125518799, -0.2615209221839905, -0.198579803109169, -0.7942801713943481, 0.7963869571685791, -0.4254416227340698, 0.5309083461761475, ...
javascript/reference/global_objects/weakset/add/index.md
JavaScript - Global Objects - WeakSet - add - Syntax - Parameters: - `value`: The value to add to the `WeakSet` object. Must be either an object or a non-registered symbol. Objects are compared by reference, not by value.
[ 0.22424447536468506, -0.17108647525310516, -0.44182080030441284, -0.16316768527030945, -0.21770481765270233, -1.9716029167175293, 1.8522624969482422, 1.4020839929580688, 0.35989654064178467, -0.2598007321357727, -1.2757103443145752, 0.7817673087120056, -0.42752090096473694, 0.6559588313102...
javascript/reference/global_objects/weakset/add/index.md
JavaScript - Global Objects - WeakSet - add - Syntax - Return value: The `WeakSet` object.
[ -0.13666662573814392, 0.4502497911453247, -0.9332281947135925, -1.0089917182922363, -0.21037377417087555, -1.8928864002227783, 1.390675663948059, 1.7723380327224731, 0.0013558700447902083, 0.18012382090091705, -1.153920292854309, 0.831943690776825, -0.3873605728149414, 0.9548095464706421, ...
javascript/reference/global_objects/weakset/add/index.md
JavaScript - Global Objects - WeakSet - add - Syntax - Exceptions: - `TypeError`: Thrown if `value` is not an object or a non-registered symbol.
[ 0.03332773223519325, -0.01493708323687315, -0.49881279468536377, 0.03183655068278313, -0.5032127499580383, -1.9360554218292236, 1.133524775505066, 1.8427687883377075, -0.21645446121692657, -0.2939892113208771, -0.644023060798645, 0.025946922600269318, -0.2646011412143707, -0.38188928365707...
javascript/reference/global_objects/weakset/add/index.md
JavaScript - Global Objects - WeakSet - add - Examples - Using add(): Example: const ws = new WeakSet(); ws.add(window); // add the window object to the WeakSet ws.has(window); // true // WeakSet only takes objects as arguments ws.add(1); // results in "TypeError: Invalid value used in weak set" in Chrome // and "...
[ -0.5044234991073608, 0.35761702060699463, -0.6426295638084412, 0.38833895325660706, -0.2234680950641632, -2.1587727069854736, 1.2948017120361328, 1.0908228158950806, 0.017316574230790138, 0.4313337504863739, -0.7172595858573914, 0.33518749475479126, -0.04418366029858589, 0.1202401667833328...
javascript/reference/global_objects/weakset/weakset/index.md
JavaScript - Global Objects - WeakSet: The `WeakSet()` constructor creates `WeakSet` objects.
[ -0.6008637547492981, 0.3091772496700287, -0.8833084106445312, 0.09456722438335419, -0.013951953500509262, -2.3098056316375732, 0.24543403089046478, 1.5812407732009888, -0.5746397972106934, 0.3001331090927124, -1.1413183212280273, 0.17902018129825592, -0.3359145224094391, 0.0370924919843673...
javascript/reference/global_objects/weakset/weakset/index.md
JavaScript - Global Objects - WeakSet - Syntax: Example: new WeakSet() new WeakSet(iterable) Note: `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`.
[ -0.30185452103614807, 0.5188008546829224, -0.1850677728652954, 0.023077715188264847, 0.07673854380846024, -2.3971285820007324, 0.20430846512317657, 1.9623932838439941, -0.15769532322883606, 0.30525100231170654, -0.8353073596954346, 0.41256076097488403, 0.18926720321178436, 0.11418519169092...
javascript/reference/global_objects/weakset/weakset/index.md
JavaScript - Global Objects - WeakSet - Syntax - Parameters: - `iterable` (optional): If an iterable object is passed, all of its elements will be added to the new `WeakSet`. `null` is treated as `undefined`.
[ -0.18703994154930115, 0.36159104108810425, -0.6625081300735474, 0.4303053915500641, 0.002277173101902008, -2.329732894897461, 1.5957690477371216, 0.8296123743057251, -0.29683443903923035, 0.5743199586868286, -1.1912407875061035, 0.0899522677063942, 0.03710988163948059, 0.8064664006233215, ...
javascript/reference/global_objects/weakset/weakset/index.md
JavaScript - Global Objects - WeakSet - Examples - Using the WeakSet object: Example: const ws = new WeakSet(); const foo = {}; const bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); // removes foo from the set ws.has(foo); // false, foo has been removed ws.has(bar); //...
[ 0.024588212370872498, 0.5836142897605896, -1.260974645614624, 0.5454177856445312, -0.2034284621477127, -2.9138386249542236, 1.1865876913070679, 1.0311344861984253, 0.32408350706100464, 0.9026716947555542, -1.172996997833252, 0.40502044558525085, -0.25631558895111084, 0.3915744721889496, ...
javascript/reference/global_objects/weakset/delete/index.md
JavaScript - Global Objects - WeakSet - delete: The `delete()` method of `WeakSet` instances removes the specified value from this set, if it is in the set. Example: const weakset = new WeakSet(); const object = {}; weakset.add(object); console.log(weakset.has(object)); // Expected output: true weakset.delete(obj...
[ -0.5387316346168518, -0.30484017729759216, -0.9049700498580933, 0.028668425977230072, 0.22186659276485443, -2.672985315322876, 1.2929502725601196, 0.8961414098739624, 0.06691043078899384, 0.6209355592727661, -0.9412810802459717, 0.12911482155323029, -0.06511619687080383, 0.2561637461185455...
javascript/reference/global_objects/weakset/delete/index.md
JavaScript - Global Objects - WeakSet - delete - Syntax: Example: weakSetInstance.delete(value)
[ -0.33874496817588806, 0.4838615953922272, -0.447841078042984, -0.6511893272399902, -0.49523261189460754, -2.293602705001831, 1.552404522895813, 1.4173598289489746, 0.32538506388664246, 0.045770179480314255, -0.7637341618537903, 0.559211254119873, 0.06360343843698502, 0.5055104494094849, ...
javascript/reference/global_objects/weakset/delete/index.md
JavaScript - Global Objects - WeakSet - delete - Syntax - Parameters: - `value`: The value to remove from the `WeakSet` object. Objects are compared by reference, not by value.
[ 0.0028567288536578417, -0.10711662471294403, -0.681954562664032, -0.5747025609016418, -0.00027665888774208724, -2.3478500843048096, 1.629343867301941, 1.0960063934326172, 0.6599671244621277, 0.08141085505485535, -1.3250387907028198, 0.7480517625808716, -0.4569547772407532, 0.55156707763671...
javascript/reference/global_objects/weakset/delete/index.md
JavaScript - Global Objects - WeakSet - delete - Syntax - Return value: `true` if a value in the `WeakSet` object has been removed successfully. `false` if the value is not found in the `WeakSet`. Always returns `false` if `value` is not an object or a non-registered symbol.
[ -0.6830906271934509, 0.09974177926778793, -0.5498448610305786, -0.2730155885219574, -0.24192196130752563, -2.9848031997680664, 1.687849760055542, 1.1810288429260254, -0.010999678634107113, 0.5418320298194885, -0.8790595531463623, 0.4797763228416443, 0.045195091515779495, 0.7306324243545532...
javascript/reference/global_objects/weakset/delete/index.md
JavaScript - Global Objects - WeakSet - delete - Examples - Using delete(): Example: const ws = new WeakSet(); const obj = {}; ws.add(window); ws.delete(obj); // Returns false. No obj found to be deleted. ws.delete(window); // Returns true. Successfully removed. ws.has(window); // Returns false. The window is no l...
[ -0.9529982209205627, 0.7178089618682861, -0.720487117767334, 0.07039438933134079, -0.23017390072345734, -2.256345748901367, 1.4320275783538818, 0.6340889930725098, 0.490396648645401, 0.87774658203125, -0.6951755881309509, 0.41020992398262024, 0.17906320095062256, 0.7495737075805664, 0.64...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array: The `Uint16Array` typed array represents an array of 16-bit unsigned integers in the platform byte order. If control over byte order is needed, use `DataView` instead. The contents are initialized to `0` unless initialization data is explicitly provided. Once established, you...
[ -0.2627345025539398, -0.46361276507377625, -0.9373122453689575, 0.31644052267074585, 0.0891156941652298, -0.6012498140335083, 0.7493622899055481, 1.5256513357162476, 0.23410093784332275, -0.004404864273965359, -0.10225576162338257, 0.5337810516357422, 0.2646677792072296, -0.134765759110450...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Constructor: - `Uint16Array()`: Creates a new `Uint16Array` object.
[ -0.3160775899887085, 0.20107924938201904, -0.7783434391021729, 0.3916513919830322, -0.46139129996299744, -1.0567282438278198, -0.4685283899307251, 1.3061503171920776, 0.006629006005823612, -0.17838673293590546, 0.12022929638624191, 0.4594222605228424, 0.12573452293872833, -0.09528797119855...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Static properties: Also inherits static properties from its parent `TypedArray`. - `Uint16Array.BYTES_PER_ELEMENT`: Returns a number value of the element size. `2` in the case of `Uint16Array`.
[ -0.6282239556312561, 0.3757607936859131, -0.9853058457374573, 0.14721450209617615, -0.23933462798595428, -1.4888365268707275, 0.4850544035434723, 1.2796874046325684, -0.2286940962076187, -0.21275050938129425, -0.2728698253631592, 1.190480351448059, -0.5361949801445007, -0.04933614656329155...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Static methods: Inherits static methods from its parent `TypedArray`.
[ -0.20087818801403046, 0.30980241298675537, -1.0143753290176392, -0.11534280329942703, -0.016295291483402252, -1.3607678413391113, 0.46165022253990173, 1.8735296726226807, -0.4733067452907562, -0.23230740427970886, -0.3449208438396454, 0.03747972846031189, -0.4609178602695465, -0.0819393992...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Instance properties: Also inherits instance properties from its parent `TypedArray`. These properties are defined on `Uint16Array.prototype` and shared by all `Uint16Array` instances. - `Uint16Array.prototype.BYTES_PER_ELEMENT`: Returns a number value of the element size. ...
[ -0.0554925911128521, -0.05924557149410248, -1.0002002716064453, 0.2929760813713074, -0.10981880873441696, -1.111923098564148, 0.1177445650100708, 1.098160743713379, 0.1754857301712036, -0.06804021447896957, -0.44854071736335754, 1.1442593336105347, -0.6971597075462341, 0.30650538206100464,...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Instance methods: Inherits instance methods from its parent `TypedArray`.
[ 0.2686607837677002, 0.05775894224643707, -0.5981000661849976, -0.00749916210770607, -0.35288774967193604, -1.176448106765747, 0.5055890083312988, 1.2457636594772339, -0.4552881717681885, -0.6370818018913269, -0.13449950516223907, 0.3157280385494232, -0.418192058801651, 0.2361564040184021, ...
javascript/reference/global_objects/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Examples - Different ways to create a Uint16Array: Example: // From a length const uint16 = new Uint16Array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.BYTES_PER_ELEMENT); // 2 // From an array const x = new Uint16A...
[ 0.2891865670681, 0.002085624262690544, -0.944995641708374, 0.4348953664302826, 0.17764775454998016, -0.532363772392273, -0.6635716557502747, 0.7561405301094055, 0.065331369638443, -0.06332433968782425, 0.4464932382106781, 0.7725983262062073, -0.4558679163455963, 0.02643791027367115, -0.1...
javascript/reference/global_objects/uint16array/uint16array/index.md
JavaScript - Global Objects - Uint16Array: The `Uint16Array()` constructor creates `Uint16Array` objects. The contents are initialized to `0` unless initialization data is explicitly provided.
[ 0.11865301430225372, 0.2447153925895691, -0.46345847845077515, 0.7958406209945679, -0.46738484501838684, -1.0712902545928955, -0.12895487248897552, 1.2189546823501587, -0.3323756754398346, -0.055415231734514236, 0.006155619863420725, 0.20633909106254578, -0.14836327731609344, -0.3674340248...
javascript/reference/global_objects/uint16array/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Syntax: Example: 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`....
[ -0.21138818562030792, 0.16690540313720703, -0.9496867060661316, -0.20586922764778137, -0.14237815141677856, -1.1678826808929443, -0.5462993383407593, 1.5292549133300781, 0.11207515001296997, -0.27679795026779175, 0.30257484316825867, 0.9739253520965576, 0.3532741069793701, 0.23656249046325...
javascript/reference/global_objects/uint16array/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Syntax - Parameters: See `TypedArray`.
[ 0.5152515769004822, 0.17293305695056915, -0.8471456170082092, -0.0613551028072834, -0.44731080532073975, -1.012417197227478, 0.2085244506597519, 1.316274642944336, -0.10626820474863052, 0.09219951182603836, 0.05413080006837845, 0.5204102993011475, 0.43392816185951233, 0.2929876446723938, ...
javascript/reference/global_objects/uint16array/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Syntax - Exceptions: See `TypedArray`.
[ 0.14098010957241058, -0.14576973021030426, -0.5420636534690857, 0.23961655795574188, -0.562515377998352, -1.4197204113006592, -0.22396153211593628, 1.459957242012024, -0.36430802941322327, -0.1049179807305336, 0.3207751512527466, 0.15945754945278168, 0.11227599531412125, 0.2580763399600982...
javascript/reference/global_objects/uint16array/uint16array/index.md
JavaScript - Global Objects - Uint16Array - Examples - Different ways to create a Uint16Array: Example: // From a length const uint16 = new Uint16Array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.BYTES_PER_ELEMENT); // 2 // From an array const x = new Uint16A...
[ 0.2891865670681, 0.002085624262690544, -0.944995641708374, 0.4348953664302826, 0.17764775454998016, -0.532363772392273, -0.6635716557502747, 0.7561405301094055, 0.065331369638443, -0.06332433968782425, 0.4464932382106781, 0.7725983262062073, -0.4558679163455963, 0.02643791027367115, -0.1...
javascript/reference/global_objects/asyncgenerator/index.md
JavaScript - Global Objects - AsyncGenerator: The `AsyncGenerator` object is returned by an `async generator function` and it conforms to both the async iterable protocol and the async iterator protocol. Async generator methods always yield `Promise` objects. `AsyncGenerator` is a subclass of the hidden `AsyncIterat...
[ -1.1836612224578857, -0.0330948606133461, -0.7753661870956421, -0.14668741822242737, -0.3595677316188812, -1.6475099325180054, -0.06067810207605362, 0.9165810346603394, -0.6907634735107422, 0.6547794342041016, -1.0116010904312134, -0.11964680254459381, -0.4661247730255127, 0.74350422620773...
javascript/reference/global_objects/asyncgenerator/index.md
JavaScript - Global Objects - AsyncGenerator - Constructor: There's no JavaScript entity that corresponds to the `AsyncGenerator` constructor. Instances of `AsyncGenerator` must be returned from async generator functions: Example: async function* createAsyncGenerator() { yield Promise.resolve(1); yield await Pro...
[ 0.6929470300674438, -0.3133375644683838, -0.6726794242858887, 0.6989415884017944, 0.18333107233047485, -0.9336881041526794, -0.2194472700357437, 1.2851046323776245, -0.2715187072753906, -0.38936832547187805, -0.5381212830543518, 0.3015350103378296, 0.40516534447669983, 0.5426399111747742, ...
javascript/reference/global_objects/asyncgenerator/index.md
JavaScript - Global Objects - AsyncGenerator - Instance properties: These properties are defined on `AsyncGenerator.prototype` and shared by all `AsyncGenerator` instances. - `AsyncGenerator.prototype.constructor`: The constructor function that created the instance object. For `AsyncGenerator` instances, the initial ...
[ -0.4115001857280731, -0.4484485983848572, -0.6951925754547119, 0.48672372102737427, -0.07942771166563034, -2.1567890644073486, 0.13745847344398499, 1.2411960363388062, 0.4157067835330963, 0.2381337285041809, -0.748304545879364, 0.20675748586654663, -0.22070243954658508, 0.2633109390735626,...
javascript/reference/global_objects/asyncgenerator/index.md
JavaScript - Global Objects - AsyncGenerator - Instance methods: Also inherits instance methods from its parent `AsyncIterator`. - `AsyncGenerator.prototype.next()`: Returns a `Promise` which will be resolved with the given value yielded by the `yield` expression. - `AsyncGenerator.prototype.return()`: Acts as if a `...
[ -0.21631799638271332, -0.19523005187511444, -0.573785662651062, 0.027755584567785263, -0.391094446182251, -1.8022550344467163, 0.3906208574771881, 1.4335745573043823, -0.05902448669075966, 0.3627226650714874, -0.6650903820991516, 0.5274186730384827, -0.38572725653648376, 0.7844368815422058...
javascript/reference/global_objects/asyncgenerator/index.md
JavaScript - Global Objects - AsyncGenerator - Examples - Async generator iteration: The following example iterates over an async generator, logging values 1–6 to the console at decreasing time intervals. Notice how each time a Promise is yielded, but it's automatically resolved within the `for await...of` loop. Exam...
[ -0.19704338908195496, 0.6352099180221558, -0.413086861371994, 0.3127956688404083, -0.5602028369903564, -1.128936529159546, 0.10342291742563248, 1.1512595415115356, -0.7790971994400024, 0.24469998478889465, 0.02394075319170952, 0.16840119659900665, -1.349853277206421, 1.1359903812408447, ...
javascript/reference/global_objects/asyncgenerator/throw/index.md
JavaScript - Global Objects - AsyncGenerator - throw: The `throw()` method of `AsyncGenerator` instances acts as if a `throw` statement is inserted in the generator's body at the current suspended position, which informs the generator of an error condition and allows it to handle the error, or perform cleanup and clos...
[ 0.1759449988603592, -0.10919535905122757, -0.8032862544059753, 0.9754002094268799, -0.42037269473075867, -2.117997646331787, 0.0830841064453125, 1.5517104864120483, 0.04257022961974144, 0.6572192907333374, -0.6418975591659546, 0.29402321577072144, 0.06313483417034149, 0.3403002917766571, ...
javascript/reference/global_objects/asyncgenerator/throw/index.md
JavaScript - Global Objects - AsyncGenerator - throw - Syntax: Example: asyncGeneratorInstance.throw(exception)
[ 0.13083137571811676, 0.3877412676811218, -0.6198064684867859, 0.26909175515174866, -0.9878900647163391, -1.7709256410598755, -0.5365400910377502, 1.5079615116119385, -0.12632521986961365, -0.420097678899765, -0.3932740092277527, 0.5681531429290771, -0.20386728644371033, 0.00176913442555814...
javascript/reference/global_objects/asyncgenerator/throw/index.md
JavaScript - Global Objects - AsyncGenerator - throw - Syntax - Parameters: - `exception`: The exception to throw. For debugging purposes, it is useful to make it an `instanceof` `Error`.
[ 0.11442811787128448, -0.17154036462306976, -0.7672256231307983, 0.4852854311466217, -0.4409223794937134, -1.7300469875335693, -0.17460931837558746, 1.5783497095108032, 0.4400204122066498, -0.4886762797832489, -0.9494596123695374, 0.6210132837295532, -0.4839726686477661, 0.7579875588417053,...
javascript/reference/global_objects/asyncgenerator/throw/index.md
JavaScript - Global Objects - AsyncGenerator - throw - Syntax - Return value: If the thrown error is not caught, it will return a `Promise` which rejects with the exception passed in. If the exception is caught by a `try...catch` and the generator resumes to yield more values, it will return a `Promise` which resolve...
[ -0.302035391330719, 0.08365426957607269, -0.37274810671806335, 0.3456295132637024, -0.6429200768470764, -1.435624122619629, 0.07558601349592209, 1.4331756830215454, -0.8439587950706482, 0.17320425808429718, -0.42846786975860596, 0.6977949738502502, -0.13759110867977142, 0.8337765336036682,...
javascript/reference/global_objects/asyncgenerator/throw/index.md
JavaScript - Global Objects - AsyncGenerator - throw - Examples - Using throw(): The following example shows a generator and an error that is thrown using the `throw` method. An error can be caught by a `try...catch` block as usual. Example: // An async task. Pretend it's doing something more useful // in practice. ...
[ 0.27700749039649963, 0.2438490241765976, -1.294315218925476, 0.06973123550415039, -0.7123215794563293, -1.1908249855041504, -0.3637695610523224, 1.2174782752990723, -0.44417810440063477, 0.035111088305711746, -0.33842146396636963, 0.47889119386672974, -0.0716312900185585, 0.181628063321113...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return: The `return()` method of `AsyncGenerator` instances acts as if a `return` statement is inserted in the generator's body at the current suspended position, which finishes the generator and allows the generator to perform any cleanup tasks when combined with a `try....
[ -0.0663677528500557, 0.32992032170295715, -0.8813499212265015, 0.8775980472564697, -0.7171268463134766, -1.7575756311416626, 0.34467118978500366, 0.9009677767753601, -0.45492857694625854, 1.4019819498062134, -0.6119498014450073, 0.6378204226493835, 0.04679661989212036, 0.8337259888648987, ...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return - Syntax: Example: asyncGeneratorInstance.return() asyncGeneratorInstance.return(value)
[ -0.013159863650798798, 0.6510576009750366, -0.4548978805541992, 0.19746366143226624, -1.075426459312439, -1.7869013547897339, -0.027502238750457764, 1.241470217704773, -0.5823405385017395, 0.23117280006408691, -0.4218835234642029, 0.7832357883453369, 0.22745685279369354, 0.1107063740491867...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return - Syntax - Parameters: - `value` (optional): The value to return.
[ -0.2254178673028946, 0.49352115392684937, -0.6070742607116699, 0.03340113162994385, -0.99897700548172, -2.0948126316070557, 0.5761268138885498, 1.1519725322723389, -0.14011065661907196, 0.42052343487739563, -0.6302683353424072, 1.0734822750091553, 0.2709212005138397, 0.8434150815010071, ...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return - Syntax - Return value: A `Promise` which resolves with an `Object` with two properties: - `done`: A boolean value: - `true` if the generator function's control flow has reached the end. - `false` if the generator function's control flow hasn't reached the en...
[ -0.5053220391273499, 0.4096651077270508, -0.1322971135377884, -0.14090338349342346, -0.8990738391876221, -1.552101492881775, 0.31678953766822815, 1.3762645721435547, -0.22702030837535858, 0.4332692623138428, -0.42597222328186035, 0.8506328463554382, -0.22750888764858246, 1.0858608484268188...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return - Description: The `return()` method, when called, can be seen as if a `return value;` statement is inserted in the generator's body at the current suspended position, where `value` is the value passed to the `return()` method. Therefore, in a typical flow, calling...
[ -0.4094366133213043, 0.5704971551895142, -0.9554002285003662, 0.5688173174858093, -0.7407360076904297, -1.6225847005844116, 0.1391162872314453, 1.40872061252594, -0.5642780065536499, 0.9575300812721252, -0.31282666325569153, 0.586711049079895, 0.12667244672775269, 1.116289496421814, -0.2...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return - Examples - Using return(): The following example shows an async generator and the `return` method. Example: // An async task. Pretend it's doing something more useful // in practice. function delayedValue(time, value) { return new Promise((resolve, reject) =>...
[ -0.383105993270874, 0.7483776807785034, -0.8218156099319458, 0.07280169427394867, -0.6425811648368835, -1.1989201307296753, -0.020608045160770416, 1.2447410821914673, -0.57026207447052, 0.5543597936630249, -0.606779932975769, 0.5669645071029663, -0.21560721099376678, 0.5170246958732605, ...
javascript/reference/global_objects/asyncgenerator/return/index.md
JavaScript - Global Objects - AsyncGenerator - return - Examples - Using return() once a generator is complete: If no `value` argument is passed into the `return()` method, the promise will resolve as if the next() method has been called. In this example the generator has completed, so the value returned is `undefined...
[ -0.16379940509796143, -0.21201682090759277, -0.34910649061203003, 0.3620639145374298, -0.11888734251260757, -0.8351747989654541, 0.11075974255800247, 0.7187737822532654, -0.8191609978675842, 0.25156211853027344, -0.4509732723236084, 0.6284021139144897, 0.37820371985435486, 0.42054992914199...
javascript/reference/global_objects/asyncgenerator/next/index.md
JavaScript - Global Objects - AsyncGenerator - next: The `next()` method of `AsyncGenerator` instances returns the next value in the sequence.
[ -0.22776223719120026, -0.00516420928761363, -1.1262904405593872, 0.3010774850845337, -0.757644534111023, -1.4644503593444824, 0.056100331246852875, 0.8659060001373291, -0.3260992467403412, 0.2861068546772003, -0.6343158483505249, 0.16499198973178864, 0.32146385312080383, 0.4767595827579498...
javascript/reference/global_objects/asyncgenerator/next/index.md
JavaScript - Global Objects - AsyncGenerator - next - Syntax: Example: next() next(value)
[ -0.12847444415092468, 0.21075549721717834, -0.7887208461761475, 0.10756264626979828, -1.1026639938354492, -1.8168286085128784, -0.07814959436655045, 1.1253046989440918, -0.10153717547655106, -0.19479061663150787, -0.10068053007125854, 0.587148904800415, 0.074372299015522, -0.08199661970138...
javascript/reference/global_objects/asyncgenerator/next/index.md
JavaScript - Global Objects - AsyncGenerator - next - Syntax - Parameters: - `value` (optional): An optional value used to modify the internal state of the generator. A value passed to the `next()` method will be received by `yield`
[ -0.6917731165885925, 0.2823807895183563, -0.7142050266265869, 0.2064107060432434, -0.9385485649108887, -1.966735601425171, 0.552226722240448, 1.4360963106155396, 0.6598695516586304, 0.050499431788921356, -0.7727394700050354, -0.07263944298028946, -0.12086953967809677, 0.4033699035644531, ...
javascript/reference/global_objects/asyncgenerator/next/index.md
JavaScript - Global Objects - AsyncGenerator - next - Syntax - Return value: A `Promise` which when resolved returns an `Object` with two properties: - `done`: A boolean value: - `true` if the generator is past the end of its control flow. In this case `value` specifies the return value of the generator (which may ...
[ -0.6160532832145691, 0.1978071928024292, -0.19131973385810852, 0.07418650388717651, -0.8383152484893799, -1.7666308879852295, 0.6421401500701904, 1.1357431411743164, -0.3754129409790039, 0.0316297747194767, -0.3526962399482727, 0.9545938372612, -0.03823862597346306, 0.498113214969635, -0...
javascript/reference/global_objects/asyncgenerator/next/index.md
JavaScript - Global Objects - AsyncGenerator - next - Examples - Using next(): The following example shows a generator and the object that the `next` method returns: Example: // An async task. Pretend it's doing something more useful // in practice. function delayedValue(time, value) { return new Promise((resolve,...
[ -0.41196170449256897, -0.2088223248720169, -0.5658939480781555, 0.19958364963531494, -0.03700447082519531, -0.35767728090286255, -0.24663284420967102, 0.6426977515220642, -0.5435149073600769, 0.0784073919057846, -0.5085523724555969, 0.3671569526195526, 0.21394644677639008, 0.38479313254356...
javascript/reference/global_objects/asyncgenerator/next/index.md
JavaScript - Global Objects - AsyncGenerator - next - Examples - Sending values to the generator: In this example, `next` is called with a value. Note: The first call does not log anything, because the generator was not yielding anything initially. Example: // An async task. Pretend it's doing something more useful...
[ -0.7808084487915039, 0.5355315804481506, -1.0120669603347778, -0.20678375661373138, -0.6415486335754395, -1.3303351402282715, -0.40554431080818176, 0.43616417050361633, -0.3780800700187683, -0.3388882577419281, 0.10198279470205307, 0.1598847210407257, 0.09713239222764969, -0.00540357735008...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf: The `indexOf()` method of `Array` instances returns the first index at which a given element can be found in the array, or -1 if it is not present. Example: const beasts = ["ant", "bison", "camel", "duck", "bison"]; console.log(beasts.indexOf("bison")); // Expected out...
[ -0.36402836441993713, -1.2091799974441528, -0.7449951767921448, 0.9206924438476562, -0.2280675172805786, -1.1077015399932861, 0.4376014769077301, 0.27046820521354675, 0.019911324605345726, 0.1192900612950325, -0.1506006121635437, -0.14476773142814636, -0.223409965634346, 0.3637551069259643...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Syntax: Example: indexOf(searchElement) indexOf(searchElement, fromIndex)
[ -0.5089269280433655, -0.5585681796073914, -0.388590931892395, -0.2266833633184433, -0.2887722849845886, -1.673830270767212, 0.04364648833870888, 0.653229832649231, -0.25074097514152527, -0.9436171650886536, -0.4999396502971649, 0.1866297870874405, -0.5798528790473938, 0.14891569316387177, ...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Syntax - 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 `-array.length <= fromIndex < 0`, `fromI...
[ -0.6633416414260864, -0.6276512145996094, -0.5893053412437439, 0.23438481986522675, 0.1791621595621109, -1.4087398052215576, 0.8918110728263855, 0.2834518849849701, -0.5670449733734131, -0.09551502764225006, -0.9544855356216431, 0.11048156023025513, -0.6784285306930542, 0.5856190323829651,...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Syntax - Return value: The first index of `searchElement` in the array; `-1` if not found.
[ -0.5046291947364807, -0.26001274585723877, -0.600303053855896, 0.21608619391918182, -0.1352270543575287, -0.7585709095001221, 1.3479433059692383, 0.9238176345825195, -0.50299072265625, -0.5047523975372314, -0.047511205077171326, 0.09984111040830612, -0.4610530436038971, 0.3022061288356781,...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Description: The `indexOf()` method compares `searchElement` to elements of the array using strict equality (the same algorithm used by the `===` operator). `NaN` values are never compared as equal, so `indexOf()` always returns `-1` when `searchElement` is `NaN`. The `...
[ -1.3489567041397095, -0.9102511405944824, -0.8825470805168152, 0.4126305878162384, 0.12013483792543411, -0.861149251461029, 1.4507670402526855, 0.15245160460472107, -0.38712313771247864, 0.3431171178817749, -0.8103840351104736, 0.07078755646944046, 0.14313071966171265, 0.5683510303497314, ...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Examples - Using indexOf(): The following example uses `indexOf()` to locate values in an array. Example: const array = [2, 9, 9]; array.indexOf(2); // 0 array.indexOf(7); // -1 array.indexOf(9, 2); // 2 array.indexOf(2, -1); // -1 array.indexOf(2, -3); // 0 You canno...
[ -0.5660542249679565, -0.5733444094657898, -0.641163170337677, 0.7274699211120605, -0.38632768392562866, -0.5546380877494812, 0.6666749119758606, 0.0005151844816282392, -0.42560067772865295, -0.1440914422273636, -0.4840901792049408, 0.028548788279294968, -0.28325796127319336, 0.305429607629...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Examples - Finding all the occurrences of an element: Example: const indices = []; const array = ["a", "b", "a", "c", "a", "d"]; const element = "a"; let idx = array.indexOf(element); while (idx !== -1) { indices.push(idx); idx = array.indexOf(element, idx + 1); } c...
[ 0.17682892084121704, -0.6077306270599365, -0.8581535220146179, 0.17130149900913239, -0.4338383674621582, -1.0151666402816772, 0.8809726238250732, -0.1264425814151764, 0.19604361057281494, -0.20080605149269104, -0.44618645310401917, -0.3463146388530731, -0.05360739678144455, 0.5955280065536...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Examples - Finding if an element exists in the array or not and updating the array: Example: function updateVegetablesCollection(veggies, veggie) { if (veggies.indexOf(veggie) === -1) { veggies.push(veggie); console.log(`New veggies collection is: ${veggies}`)...
[ -0.4966525137424469, -0.27075836062431335, -0.05488394945859909, 1.0131518840789795, 0.2985796332359314, -0.5158473253250122, 0.34627923369407654, 0.4335257411003113, -0.435186505317688, 0.08271526545286179, -0.38725486397743225, -0.5755615830421448, -0.2990742325782776, 0.4495471715927124...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Examples - Using indexOf() on sparse arrays: You cannot use `indexOf()` to search for empty slots in sparse arrays. Example: console.log([1, , 3].indexOf(undefined)); // -1
[ -0.8471680283546448, -0.10703830420970917, -0.8914387226104736, 0.9535162448883057, 0.20539158582687378, -0.8862358331680298, 1.5800875425338745, -0.13007108867168427, -0.6673832535743713, -0.1501842737197876, -0.22895194590091705, -0.1829625964164734, 0.3221554458141327, -0.03723044320940...
javascript/reference/global_objects/array/indexof/index.md
JavaScript - Global Objects - Array - indexOf - Examples - Calling indexOf() on non-array objects: The `indexOf()` method reads the `length` property of `this` and then accesses each property whose key is a nonnegative integer less than `length`. Example: const arrayLike = { length: 3, 0: 2, 1: 3, 2: 4, 3:...
[ -1.0483373403549194, -0.49915626645088196, -0.6109928488731384, 0.5332013964653015, 0.2534550428390503, -0.9343958497047424, 0.7253191471099854, -0.151575967669487, -0.6101903915405273, -0.0697297677397728, -0.9115069508552551, -0.07906870543956757, -0.07105669379234314, 0.2256674617528915...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast: The `findLast()` method of `Array` instances iterates the array in reverse order and returns the value of the first element that satisfies the provided testing function. If no elements satisfy the testing function, `undefined` is returned. If you need to find: - the fi...
[ 0.05865208059549332, -0.6894214749336243, -0.7089446187019348, 0.3117430806159973, -0.23959535360336304, -0.7286543250083923, 0.8110601305961609, 0.06409109383821487, -0.6196439266204834, 0.7219216823577881, -0.27002018690109253, 0.012784697115421295, -0.21718251705169678, 0.95252972841262...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Syntax: Example: findLast(callbackFn) findLast(callbackFn, thisArg)
[ -0.31861457228660583, 0.13533909618854523, -0.034219298511743546, 0.03454230725765228, -1.063801884651184, -1.4282745122909546, 0.9081934690475464, 0.8093780279159546, -0.674720048904419, -0.12017025053501129, -0.5668684244155884, 0.29783526062965393, -0.553604006767273, 1.003237009048462,...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Syntax - Parameters: - `callbackFn`: A function to execute for each element in the array. It should return a truthy value to indicate a matching element has been found, and a falsy value otherwise. The function is called with the following arguments: - `element`: The ...
[ -0.5535688400268555, -0.30166417360305786, -0.7363602519035339, -0.057582005858421326, -0.5608227849006653, -1.533845067024231, 1.2038986682891846, 0.05544756352901459, -0.6604892611503601, 0.4910711348056793, -0.881538987159729, 0.35354986786842346, -0.8300174474716187, 1.6549155712127686...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Syntax - Return value: The last (highest-index) element in the array that satisfies the provided testing function; `undefined` if no matching element is found.
[ -0.05555634945631027, -0.5578628182411194, -0.41732966899871826, 0.0625096932053566, -0.601549506187439, -0.6974755525588989, 0.8759992718696594, 0.4286101162433624, -0.4830625057220459, 0.5071873664855957, -0.48064717650413513, 0.596229612827301, -0.10414449870586395, 1.171999454498291, ...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Description: The `findLast()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in descending-index order, until `callbackFn` returns a truthy value. `findLast()` then returns that element and stops iterating thro...
[ -1.073758840560913, -0.4041438102722168, -0.7517454028129578, 0.16045156121253967, 0.04017117619514465, -0.7727352976799011, 1.3160619735717773, -0.0319124236702919, -1.3931350708007812, 1.0508754253387451, -0.441601425409317, 0.49299493432044983, -0.2970479130744934, 1.3270699977874756, ...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Find last object in an array matching on element properties: This example shows how you might create a test based on the properties of array elements. Example: const inventory = [ { name: "apples", quantity: 2 }, { name: "bananas", quantity: 0 }, { na...
[ 0.5606914162635803, -0.5053189396858215, -0.3881382942199707, 0.5019624829292297, -0.29009008407592773, -1.5096724033355713, 0.5884730219841003, 0.19405803084373474, -0.8253509998321533, 0.1433066576719284, -0.5161613821983337, 0.010381513275206089, -0.5081321001052856, 0.4923170804977417,...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Find last object in an array matching on element properties - Using arrow function and destructuring: The previous example might be written using an arrow function and object destructuring: Example: const inventory = [ { name: "apples", quantity: 2 }, {...
[ 0.5288879871368408, -0.6856604218482971, -0.9183248281478882, 0.46168726682662964, -0.5292398929595947, -1.58988618850708, 0.5366606116294861, -0.046361010521650314, -0.3914465010166168, 0.21233616769313812, -0.6050055623054504, -0.594595730304718, -0.3142170310020447, 0.353622704744339, ...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Find the last prime number in an array: The following example returns the last element in the array that is a prime number, or `undefined` if there is no prime number. Example: function isPrime(n) { if (n < 2) { return false; } if (n % 2 === 0) { ...
[ -0.2454574853181839, -0.08789817988872528, -0.3867272138595581, -0.37165749073028564, -0.6361868977546692, -0.9447697997093201, 1.5403242111206055, 0.9232057332992554, -0.6867239475250244, 0.7909210920333862, -0.31516045331954956, -0.14632917940616608, -0.6435010433197021, -0.0428429134190...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Find the most recent completed task: This example demonstrates a practical use case for `findLast()` when working with time-ordered data. It finds the most recent completed task from a list already sorted by `timestamp`. Example: const tasks = [ { name: "...
[ -0.6906190514564514, -0.2694568336009979, -0.8258418440818787, 0.33582356572151184, -0.34039804339408875, -0.5454251170158386, 0.402748167514801, 0.016440480947494507, -0.1358553022146225, 1.1121811866760254, -0.18858110904693604, 0.19268764555454254, 0.16941261291503906, 0.893051743507385...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Using the third argument of callbackFn: The `array` argument is useful if you want to access another element in the array, especially when you don't have an existing variable that refers to the array. The following example first uses `filter()` to extract the...
[ -0.40636494755744934, -0.06695828586816788, -0.45063516497612, -0.1577972173690796, -0.4714653193950653, -1.2726784944534302, 1.3171277046203613, -0.6914318799972534, -0.9229998588562012, 0.9829221963882446, -0.8380183577537537, -0.0706777423620224, -0.2433653175830841, 0.8227248191833496,...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Using findLast() on sparse arrays: Empty slots in sparse arrays are visited, and are treated the same as `undefined`. Example: // Declare array with no elements at indexes 2, 3, and 4 const array = [0, 1, , , , 5, 6]; // Shows all indexes, not just those w...
[ -0.21570532023906708, 0.1478256732225418, -0.4760884940624237, 0.617065966129303, 0.17281131446361542, -0.8902983665466309, 1.6101880073547363, -0.21356219053268433, -0.4156053960323334, 1.172551155090332, 0.19182395935058594, 0.1029849648475647, -0.08405191451311111, 0.5473151803016663, ...
javascript/reference/global_objects/array/findlast/index.md
JavaScript - Global Objects - Array - findLast - Examples - Calling findLast() on non-array objects: The `findLast()` method reads the `length` property of `this` and then accesses each property whose key is a nonnegative integer less than `length`. Example: const arrayLike = { length: 3, 0: 2, 1: 7.3, 2: 4,...
[ -0.6558818817138672, -0.19521905481815338, -0.31640610098838806, 0.3906210660934448, -0.15955325961112976, -0.7901277542114258, 1.0554778575897217, -0.18411891162395477, -0.9599546790122986, 0.2619841694831848, -0.7987876534461975, -0.10124748945236206, -0.1939719170331955, 0.1709802895784...