file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/typedarray/symbol.species/index.md | JavaScript - Global Objects - TypedArray - Symbol.species - Examples - Species in ordinary objects:
The `[Symbol.species]` property returns the default constructor function, which is one of the typed array constructors itself for any given typed array constructor.
Example:
Int8Array[Symbol.species]; // function Int8... | [
-0.9427236318588257,
0.024617506191134453,
-1.6656655073165894,
0.310345858335495,
-0.08942899107933044,
-1.6707031726837158,
-0.7558780908584595,
1.3482435941696167,
-0.5258716940879822,
0.10277905315160751,
-0.07689229398965836,
0.8849210739135742,
-0.17178073525428772,
-0.10254280269145... |
javascript/reference/global_objects/typedarray/symbol.species/index.md | JavaScript - Global Objects - TypedArray - Symbol.species - Examples - Species in derived objects:
In an instance of a custom `TypedArray` subclass, such as `MyTypedArray`, the `MyTypedArray` species is the `MyTypedArray` constructor. However, you might want to overwrite this, in order to return a parent typed array o... | [
-0.19119708240032196,
-0.25905928015708923,
-0.5050901174545288,
0.3802451193332672,
0.30486342310905457,
-0.5960603952407837,
-0.10973641276359558,
0.9194488525390625,
0.005941614042967558,
-0.24101410806179047,
-0.2456607222557068,
0.18061120808124542,
0.0883796215057373,
0.2609687149524... |
javascript/reference/global_objects/typedarray/some/index.md | JavaScript - Global Objects - TypedArray - some:
The `some()` method of `TypedArray` instances returns `true` if it finds an element in the array that satisfies the provided testing function. Otherwise, it returns `false`. This method has the same algorithm as `Array.prototype.some()`.
Example:
function isNegative(e... | [
-0.7297475934028625,
-1.1034377813339233,
-0.918520987033844,
0.019688576459884644,
0.34986603260040283,
-1.234694480895996,
0.049902502447366714,
1.4077460765838623,
-0.681721031665802,
1.3624727725982666,
0.1755095273256302,
0.26929306983947754,
0.07072404026985168,
-0.2064208835363388,
... |
javascript/reference/global_objects/typedarray/some/index.md | JavaScript - Global Objects - TypedArray - some - Syntax:
Example:
some(callbackFn)
some(callbackFn, thisArg) | [
0.030000822618603706,
0.6396546959877014,
-0.9650590419769287,
-0.18169276416301727,
-0.857483446598053,
-1.7555209398269653,
0.6779974102973938,
1.4169890880584717,
-0.8200240731239319,
0.23545929789543152,
-0.5035956501960754,
0.334897518157959,
-0.8478723764419556,
0.5926653742790222,
... |
javascript/reference/global_objects/typedarray/some/index.md | JavaScript - Global Objects - TypedArray - some - Syntax - Parameters:
- `callbackFn`: A function to execute for each element in the typed array. It should return a truthy value to indicate the element passes the test, and a falsy value otherwise. The function is called with the following arguments:
- `element`: The... | [
-0.44880378246307373,
-0.021602775901556015,
-1.2420884370803833,
-0.19648759067058563,
-0.17732593417167664,
-1.1172916889190674,
0.7611011862754822,
0.29467543959617615,
-0.8333393931388855,
0.5598790049552917,
-0.7095140814781189,
0.38155102729797363,
-0.926592230796814,
1.4537823200225... |
javascript/reference/global_objects/typedarray/some/index.md | JavaScript - Global Objects - TypedArray - some - Syntax - Return value:
`false` unless `callbackFn` returns a `truthy` value for a typed array element, in which case `true` is immediately returned. | [
-0.735427737236023,
0.6435080170631409,
-0.514939546585083,
0.1402050256729126,
-0.9944472312927246,
-1.534622311592102,
0.7864276170730591,
0.4600059390068054,
-0.8678230047225952,
0.750421404838562,
-0.3573889434337616,
0.28921499848365784,
0.12220767885446548,
0.6043341755867004,
-0.5... |
javascript/reference/global_objects/typedarray/some/index.md | JavaScript - Global Objects - TypedArray - some - Description:
See `Array.prototype.some()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.13481870293617249,
0.250791996717453,
-0.722194492816925,
0.2000674307346344,
-0.15619193017482758,
-0.8278093338012695,
0.17371821403503418,
1.1859954595565796,
-0.3229794204235077,
0.18166540563106537,
-0.3773205280303955,
0.20597361028194427,
0.1580735743045807,
-0.4021800458431244,
... |
javascript/reference/global_objects/typedarray/some/index.md | JavaScript - Global Objects - TypedArray - some - Examples - Testing size of all typed array elements:
The following example tests whether any element in the typed array is bigger than 10.
Example:
function isBiggerThan10(element, index, array) {
return element > 10;
}
new Uint8Array([2, 5, 8, 1, 4]).some(isBigger... | [
0.1612105369567871,
-0.48590293526649475,
-1.3095821142196655,
0.26862913370132446,
-0.5423588156700134,
-1.2568951845169067,
0.49785950779914856,
0.8691731095314026,
-0.6862708330154419,
0.04888370260596275,
-0.1911405622959137,
-0.15140680968761444,
-0.887881338596344,
-0.364417403936386... |
javascript/reference/global_objects/typedarray/toreversed/index.md | JavaScript - Global Objects - TypedArray - toReversed:
The `toReversed()` method of `TypedArray` instances is the copying counterpart of the `reverse()` method. It returns a new typed array with the elements in reversed order. This method has the same algorithm as `Array.prototype.toReversed()`. | [
-0.4037194550037384,
-0.06236732006072998,
-0.6056880354881287,
0.06121483072638512,
-0.0691731795668602,
-0.7189393043518066,
0.17743533849716187,
1.0019704103469849,
-0.3086147606372833,
0.5213285088539124,
-0.8778100609779358,
-0.038455892354249954,
-0.15288949012756348,
0.3712674081325... |
javascript/reference/global_objects/typedarray/toreversed/index.md | JavaScript - Global Objects - TypedArray - toReversed - Syntax:
Example:
toReversed() | [
-0.18470798432826996,
0.7900859713554382,
-0.3136958181858063,
-0.07064852863550186,
-0.652818500995636,
-1.2213988304138184,
0.2714768350124359,
0.9934888482093811,
-0.5162209272384644,
-0.15773704648017883,
-0.5093106627464294,
0.39911070466041565,
-0.6236283779144287,
0.0868710801005363... |
javascript/reference/global_objects/typedarray/toreversed/index.md | JavaScript - Global Objects - TypedArray - toReversed - Syntax - Parameters:
None. | [
0.04909483715891838,
0.5430946946144104,
-0.6529733538627625,
-0.5674317479133606,
-0.6307517290115356,
-0.9225706458091736,
0.5856509804725647,
1.1447845697402954,
-0.4695841670036316,
-0.36411795020103455,
-0.9084275960922241,
-0.1642315834760666,
-0.11184265464544296,
0.0121556678786873... |
javascript/reference/global_objects/typedarray/toreversed/index.md | JavaScript - Global Objects - TypedArray - toReversed - Syntax - Return value:
A new typed array containing the elements in reversed order. | [
0.041831739246845245,
-0.04542350023984909,
-0.6457846760749817,
-0.059964608401060104,
-0.452458918094635,
-0.827528715133667,
0.047181978821754456,
1.2473946809768677,
0.0792568102478981,
0.30273494124412537,
-0.7773441672325134,
0.40872788429260254,
-0.6246774792671204,
0.66898536682128... |
javascript/reference/global_objects/typedarray/toreversed/index.md | JavaScript - Global Objects - TypedArray - toReversed - Description:
See `Array.prototype.toReversed()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.39892318844795227,
0.38556143641471863,
-0.15920017659664154,
0.3752686381340027,
-0.27708080410957336,
-0.989118218421936,
0.09342686831951141,
0.9366065859794617,
-0.3972202241420746,
0.19160595536231995,
-0.8848047256469727,
0.3864225745201111,
0.11917095631361008,
-0.110445618629455... |
javascript/reference/global_objects/typedarray/toreversed/index.md | JavaScript - Global Objects - TypedArray - toReversed - Examples - Using toReversed():
Example:
const uint8 = new Uint8Array([1, 2, 3]);
const reversedUint8 = uint8.toReversed();
console.log(reversedUint8); // Uint8Array [3, 2, 1]
console.log(uint8); // Uint8Array [1, 2, 3] | [
-0.45131123065948486,
0.1745387762784958,
-0.6910570859909058,
0.2758340835571289,
-0.2738182544708252,
-1.0420409440994263,
-0.7293885946273804,
0.5587787628173828,
-0.5925150513648987,
0.20753982663154602,
-0.5734587907791138,
0.6004639863967896,
-0.005517197772860527,
-0.170819044113159... |
javascript/reference/global_objects/typedarray/set/index.md | JavaScript - Global Objects - TypedArray - set:
The `set()` method of `TypedArray` instances stores multiple values in the typed array, reading input values from a specified array.
Example:
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
// Copy... | [
-0.12692248821258545,
-0.6161065101623535,
-1.5785189867019653,
1.2016334533691406,
0.19344821572303772,
-0.5795734524726868,
-0.834989070892334,
0.9294768571853638,
0.33495867252349854,
-0.030262012034654617,
-0.5363465547561646,
0.3883216381072998,
0.4100377857685089,
-0.1014232933521270... |
javascript/reference/global_objects/typedarray/set/index.md | JavaScript - Global Objects - TypedArray - set - Syntax:
Example:
set(array)
set(array, targetOffset)
set(typedarray)
set(typedarray, targetOffset) | [
0.019388046115636826,
-0.15152740478515625,
-1.4270292520523071,
-0.15546463429927826,
-0.5701228976249695,
-1.2876815795898438,
-0.10530881583690643,
1.2721871137619019,
-0.08114001899957657,
-0.4625096023082733,
-0.4074479639530182,
0.3034486174583435,
-0.23629048466682434,
-0.0221129767... |
javascript/reference/global_objects/typedarray/set/index.md | JavaScript - Global Objects - TypedArray - set - Syntax - Parameters:
- `array`: The array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the target offset exceeds the length of the target array, in which case an exception is thr... | [
-0.46163737773895264,
-0.7419736385345459,
-1.5521749258041382,
0.3373800218105316,
0.11415214836597443,
-1.5367565155029297,
0.20290301740169525,
0.8977428078651428,
0.2000737190246582,
-0.5001246929168701,
-0.7419533133506775,
0.43078482151031494,
-0.40530067682266235,
0.2730392217636108... |
javascript/reference/global_objects/typedarray/set/index.md | JavaScript - Global Objects - TypedArray - set - Syntax - Return value:
None (`undefined`). | [
-0.4236963987350464,
0.13530230522155762,
-1.1501919031143188,
-0.4568967819213867,
-0.5802961587905884,
-1.0573264360427856,
0.3673696517944336,
1.4054635763168335,
-0.6533676385879517,
-0.05695372447371483,
0.0016450645634904504,
0.05032598599791527,
0.022884229198098183,
0.1493155807256... |
javascript/reference/global_objects/typedarray/set/index.md | JavaScript - Global Objects - TypedArray - set - Syntax - Exceptions:
- `RangeError`: Thrown in one of the following cases:
- An element will be stored beyond the end of the typed array, either because `targetOffset` is too large or because `array` or `typedarray` is too large.
- `targetOffset` is negative. | [
-0.42432552576065063,
-0.5724781155586243,
-1.0614211559295654,
0.08093540370464325,
-0.3141878545284271,
-1.3848053216934204,
-0.6984336376190186,
1.0367405414581299,
-0.7656926512718201,
-0.11233193427324295,
0.028741061687469482,
0.37405645847320557,
-1.0184826850891113,
-0.008645999245... |
javascript/reference/global_objects/typedarray/set/index.md | JavaScript - Global Objects - TypedArray - set - Examples - Using set():
Example:
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.set([1, 2, 3], 3);
console.log(uint8); // Uint8Array [ 0, 0, 0, 1, 2, 3, 0, 0 ] | [
-0.3799017071723938,
-0.292304664850235,
-1.60940420627594,
0.8280906081199646,
-0.3307148516178131,
-0.9849790930747986,
-0.6987326145172119,
0.8655234575271606,
-0.2073659598827362,
-0.08247899264097214,
-0.4244842529296875,
0.510166585445404,
0.45633548498153687,
-0.3055451810359955,
... |
javascript/reference/global_objects/typedarray/filter/index.md | JavaScript - Global Objects - TypedArray - filter:
The `filter()` method of `TypedArray` instances creates a copy of a portion of a given typed array, filtered down to just the elements from the given typed array that pass the test implemented by the provided function. This method has the same algorithm as `Array.prot... | [
-0.2835354506969452,
-1.428837776184082,
-1.0429511070251465,
0.41220933198928833,
0.8974313139915466,
-0.945610761642456,
-0.3076687455177307,
1.092579960823059,
-0.7842146158218384,
1.493077278137207,
-0.2874404191970825,
-0.2797242999076843,
-0.1485377997159958,
0.20361743867397308,
-... |
javascript/reference/global_objects/typedarray/filter/index.md | JavaScript - Global Objects - TypedArray - filter - Syntax:
Example:
filter(callbackFn)
filter(callbackFn, thisArg) | [
-0.049838438630104065,
-0.01797376200556755,
-0.5988022685050964,
-0.34799474477767944,
-0.756598711013794,
-1.7034363746643066,
0.6403697729110718,
1.0932685136795044,
-1.1027179956436157,
0.38219666481018066,
-0.3242633044719696,
0.02642144449055195,
-0.38848501443862915,
0.9123343229293... |
javascript/reference/global_objects/typedarray/filter/index.md | JavaScript - Global Objects - TypedArray - filter - Syntax - Parameters:
- `callbackFn`: A function to execute for each element in the typed array. It should return a truthy value to keep the element in the resulting typed array, and a falsy value otherwise. The function is called with the following arguments:
- `el... | [
-0.2951154410839081,
-0.42802536487579346,
-1.2702428102493286,
-0.08119393140077591,
-0.14074386656284332,
-1.19741952419281,
0.7555314898490906,
0.2558530867099762,
-0.7702279090881348,
0.8811680674552917,
-0.4754890501499176,
0.24111975729465485,
-0.8421478271484375,
1.3681864738464355,... |
javascript/reference/global_objects/typedarray/filter/index.md | JavaScript - Global Objects - TypedArray - filter - Syntax - Return value:
A copy of the given typed array containing just the elements that pass the test. If no elements pass the test, an empty typed array is returned. | [
-0.04968034848570824,
-0.40926921367645264,
-0.7647213935852051,
0.09239719808101654,
-0.10004571080207825,
-1.004677414894104,
0.5387868881225586,
1.2575129270553589,
-0.7453398108482361,
0.23596340417861938,
-0.4430096447467804,
0.10948388278484344,
-0.0007767347851768136,
0.701502382755... |
javascript/reference/global_objects/typedarray/filter/index.md | JavaScript - Global Objects - TypedArray - filter - Description:
See `Array.prototype.filter()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.2101442515850067,
-0.33455076813697815,
-0.6297127604484558,
0.13028289377689362,
-0.15255635976791382,
-0.8467662930488586,
-0.06323496252298355,
1.0095717906951904,
-0.4020407199859619,
0.24336665868759155,
-0.34931108355522156,
-0.14714547991752625,
0.47882065176963806,
-0.1204663887... |
javascript/reference/global_objects/typedarray/filter/index.md | JavaScript - Global Objects - TypedArray - filter - Examples - Filtering out all small values:
The following example uses `filter()` to create a filtered typed array that has all elements with values less than 10 removed.
Example:
function isBigEnough(element, index, array) {
return element >= 10;
}
new Uint8Array... | [
-0.044149938970804214,
-0.7115034461021423,
-1.3095403909683228,
0.58707195520401,
-0.23337170481681824,
-1.4392439126968384,
0.27086734771728516,
0.4716186821460724,
-0.9913797974586487,
0.5164614319801331,
-0.22325196862220764,
-0.0026146091986447573,
-0.43759360909461975,
-0.11819235980... |
javascript/reference/global_objects/typedarray/of/index.md | JavaScript - Global Objects - TypedArray - of:
The `TypedArray.of()` static method creates a new typed array from a variable number of arguments. This method is nearly the same as `Array.of()`.
Example:
const int16array = Int16Array.of("10", "20", "30", "40", "50");
console.log(int16array);
// Expected output: Int1... | [
-0.007865115068852901,
-0.7811252474784851,
-0.9015894532203674,
0.7021452188491821,
0.6961909532546997,
-0.6058768630027771,
0.019725896418094635,
1.0154167413711548,
0.49171143770217896,
0.42260000109672546,
-0.12018533796072006,
0.46523571014404297,
-0.2947104871273041,
-0.0419916138052... |
javascript/reference/global_objects/typedarray/of/index.md | JavaScript - Global Objects - TypedArray - of - Syntax:
Example:
TypedArray.of()
TypedArray.of(element1)
TypedArray.of(element1, element2)
TypedArray.of(element1, element2, /* …, */ elementN)
Where `TypedArray` is one of:
- `Int8Array`
- `Uint8Array`
- `Uint8ClampedArray`
- `Int16Array`
- `Uint16Array`
- `Int32Arra... | [
0.4114052653312683,
-0.2325368970632553,
-0.4004227817058563,
-0.32515761256217957,
-0.22222813963890076,
-0.9687579274177551,
-0.4707469344139099,
0.9670886993408203,
0.23688332736492157,
0.3324322998523712,
0.030520349740982056,
-0.32164624333381653,
-0.6653345227241516,
-0.0490507893264... |
javascript/reference/global_objects/typedarray/of/index.md | JavaScript - Global Objects - TypedArray - of - Syntax - Parameters:
- `element1`, …, `elementN`: Elements used to create the typed array. | [
0.8856983780860901,
-0.1713951677083969,
-0.9618057608604431,
-0.018708324059844017,
-0.2957300543785095,
-1.4903839826583862,
0.34355393052101135,
0.8846920728683472,
-0.2568572461605072,
0.13201862573623657,
-0.2902367413043976,
0.02287362329661846,
-0.9391436576843262,
0.057471144944429... |
javascript/reference/global_objects/typedarray/of/index.md | JavaScript - Global Objects - TypedArray - of - Syntax - Return value:
A new `TypedArray` instance. | [
0.7190359234809875,
-0.4590011537075043,
-0.8457205295562744,
-0.3206755220890045,
-0.44428741931915283,
-0.5775625705718994,
0.05910317599773407,
1.5774081945419312,
0.2002379596233368,
0.28518322110176086,
0.14268234372138977,
-0.4195071756839752,
0.009577232412993908,
0.8563252687454224... |
javascript/reference/global_objects/typedarray/of/index.md | JavaScript - Global Objects - TypedArray - of - Description:
See `Array.of()` for more details. There are some subtle distinctions between `Array.of()` and `TypedArray.of()`:
- If the `this` value passed to `TypedArray.of()` is not a constructor, `TypedArray.of()` will throw a `TypeError`, while `Array.of()` defaults... | [
-0.7393865585327148,
-0.14451032876968384,
-0.8735786080360413,
1.239899754524231,
0.8695936799049377,
-0.6036713719367981,
0.2854807674884796,
1.3227107524871826,
-0.06432274729013443,
0.7130927443504333,
-0.4968588054180145,
0.24407103657722473,
0.2920936644077301,
0.5515460968017578,
... |
javascript/reference/global_objects/typedarray/of/index.md | JavaScript - Global Objects - TypedArray - of - Examples - Using of():
Example:
Uint8Array.of(1); // Uint8Array [ 1 ]
Int8Array.of("1", "2", "3"); // Int8Array [ 1, 2, 3 ]
Float32Array.of(1, 2, 3); // Float32Array [ 1, 2, 3 ]
Int16Array.of(undefined); // Int16Array [ 0 ] | [
-0.007922080345451832,
-0.11012918502092361,
-0.805859386920929,
0.00849006325006485,
0.18430030345916748,
-0.6775080561637878,
-0.23037709295749664,
0.7130457758903503,
-0.37395551800727844,
0.08178411424160004,
-0.2892612814903259,
0.24212811887264252,
0.23962482810020447,
-0.19852904975... |
javascript/reference/global_objects/typedarray/find/index.md | JavaScript - Global Objects - TypedArray - find:
The `find()` method of `TypedArray` instances returns the first element in the provided typed array that satisfies the provided testing function. If no values satisfy the testing function, `undefined` is returned. This method has the same algorithm as `Array.prototype.f... | [
-0.47729089856147766,
-1.166110873222351,
-0.6248692274093628,
0.384495347738266,
0.28415998816490173,
-0.8271977305412292,
0.3340281844139099,
0.8193944096565247,
-0.8219433426856995,
1.119118571281433,
0.06312385946512222,
-0.10800058394670486,
-0.22266770899295807,
0.10589290410280228,
... |
javascript/reference/global_objects/typedarray/find/index.md | JavaScript - Global Objects - TypedArray - find - Syntax:
Example:
find(callbackFn)
find(callbackFn, thisArg) | [
-0.10392692685127258,
0.26028716564178467,
-0.527654767036438,
-0.024398967623710632,
-0.9140905141830444,
-1.2989481687545776,
0.6557609438896179,
1.0572137832641602,
-0.5706121921539307,
0.0602172426879406,
-0.35582542419433594,
0.08642937242984772,
-0.943933367729187,
0.9479116201400757... |
javascript/reference/global_objects/typedarray/find/index.md | JavaScript - Global Objects - TypedArray - find - Syntax - Parameters:
- `callbackFn`: A function to execute for each element in the typed 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... | [
-0.4578777253627777,
-0.2256995141506195,
-1.1479711532592773,
0.03770856186747551,
-0.23184901475906372,
-0.9500045776367188,
0.8064847588539124,
0.18113663792610168,
-0.5955315828323364,
0.6270095109939575,
-0.6674983501434326,
0.1963774710893631,
-0.9982332587242126,
1.5142066478729248,... |
javascript/reference/global_objects/typedarray/find/index.md | JavaScript - Global Objects - TypedArray - find - Syntax - Return value:
The first element in the typed array that satisfies the provided testing function. Otherwise, `undefined` is returned. | [
-0.07098842412233353,
-0.18329104781150818,
-0.7320011854171753,
0.06545640528202057,
-0.338096022605896,
-0.5515031218528748,
0.6673312783241272,
0.8390279412269592,
-0.3577077090740204,
0.5086734294891357,
-0.20464934408664703,
0.2509605288505554,
-0.33816832304000854,
0.4507658183574676... |
javascript/reference/global_objects/typedarray/find/index.md | JavaScript - Global Objects - TypedArray - find - Description:
See `Array.prototype.find()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.08141762018203735,
-0.16987526416778564,
-0.5404466986656189,
0.334182471036911,
-0.27846065163612366,
-0.661928117275238,
0.15185868740081787,
0.9584624171257019,
-0.10514101386070251,
0.002246471121907234,
-0.4407248795032501,
-0.15941843390464783,
-0.002937960671260953,
0.06196236610... |
javascript/reference/global_objects/typedarray/find/index.md | JavaScript - Global Objects - TypedArray - find - Examples - Find the first prime number in a typed array:
The following example returns the first element in the typed 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... | [
-0.12312014400959015,
-0.22911298274993896,
-0.7724292874336243,
0.0696844682097435,
-0.46232208609580994,
-0.471932053565979,
1.1970739364624023,
1.2854959964752197,
-0.7981916666030884,
0.846113383769989,
-0.5596897006034851,
-0.6365360617637634,
-0.6907355785369873,
-0.6090265512466431,... |
javascript/reference/global_objects/typedarray/tostring/index.md | JavaScript - Global Objects - TypedArray - toString:
The `toString()` method of `TypedArray` instances returns a string representing the specified typed array and its elements. This method has the same algorithm as `Array.prototype.toString()`.
Example:
const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
const uint... | [
-0.6252572536468506,
-0.6970766186714172,
-0.8572947978973389,
0.1788933128118515,
0.035427164286375046,
-1.411263108253479,
-0.6079811453819275,
0.5606080889701843,
-0.3860575258731842,
0.4119562804698944,
-0.02937927097082138,
0.709090530872345,
0.253439337015152,
-0.01046383660286665,
... |
javascript/reference/global_objects/typedarray/tostring/index.md | JavaScript - Global Objects - TypedArray - toString - Syntax:
Example:
toString() | [
-0.568953812122345,
0.2090635448694229,
-0.4152331054210663,
-0.00786321796476841,
-0.3930613696575165,
-1.860558271408081,
0.015978015959262848,
0.6480801105499268,
-0.22963406145572662,
-0.5848811268806458,
-0.04627540335059166,
0.1770162284374237,
-0.28595778346061707,
-0.39497619867324... |
javascript/reference/global_objects/typedarray/tostring/index.md | JavaScript - Global Objects - TypedArray - toString - Syntax - Parameters:
None. | [
-0.24466824531555176,
0.1784055531024933,
-0.6720222234725952,
-0.5980051159858704,
-0.4193412661552429,
-1.2927143573760986,
0.43483129143714905,
0.9775175452232361,
-0.4761612117290497,
-0.6462796926498413,
-0.5305345058441162,
-0.5849833488464355,
0.06939160078763962,
-0.288641542196273... |
javascript/reference/global_objects/typedarray/tostring/index.md | JavaScript - Global Objects - TypedArray - toString - Syntax - Return value:
A string representing the elements of the typed array. | [
-0.19377075135707855,
-0.3528898060321808,
-0.6814447045326233,
0.07072054594755173,
-0.4306443929672241,
-1.5865187644958496,
0.3018518388271332,
1.1362264156341553,
-0.24658805131912231,
-0.011285820044577122,
-0.3597128391265869,
0.6148374676704407,
-0.6879554986953735,
0.58833128213882... |
javascript/reference/global_objects/typedarray/tostring/index.md | JavaScript - Global Objects - TypedArray - toString - Description:
See `Array.prototype.toString()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.6273154616355896,
0.02062739059329033,
-0.1519390046596527,
0.3312784433364868,
-0.035378631204366684,
-1.38504958152771,
-0.10376213490962982,
0.6511703729629517,
-0.29954004287719727,
-0.24365964531898499,
-0.6205252408981323,
0.03817146643996239,
0.44692522287368774,
-0.3392313718795... |
javascript/reference/global_objects/typedarray/tostring/index.md | JavaScript - Global Objects - TypedArray - toString - Examples - Converting a typed array to a string:
Example:
const uint8 = new Uint8Array([1, 2, 3]);
// Explicit conversion
console.log(uint8.toString()); // 1,2,3
// Implicit conversion
console.log(`${uint8}`); // 1,2,3 | [
-0.27896010875701904,
-0.17986589670181274,
-0.6988940834999084,
0.5134214162826538,
-0.128397136926651,
-1.7981431484222412,
-1.0988121032714844,
0.5285305976867676,
-0.21913199126720428,
-0.1077636256814003,
0.13045142590999603,
0.30931857228279114,
0.19548285007476807,
-0.41285926103591... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys:
The `keys()` method of `TypedArray` instances returns a new array iterator object that contains the keys for each index in the typed array. This method has the same algorithm as `Array.prototype.keys()`.
Example:
const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
con... | [
0.057074543088674545,
-0.8329218029975891,
-1.4921313524246216,
0.5309732556343079,
0.06794306635856628,
-0.36660441756248474,
-0.5480229258537292,
0.9037618041038513,
-0.6417317390441895,
0.6238256096839905,
0.28698503971099854,
0.8687704205513,
0.48994821310043335,
0.5609549283981323,
... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys - Syntax:
Example:
keys() | [
0.5780519843101501,
-0.17717477679252625,
-1.5366407632827759,
-0.020599089562892914,
-0.6770827770233154,
-1.159250259399414,
0.5764046907424927,
1.2086702585220337,
-0.5385941863059998,
-0.12033378332853317,
0.1448090374469757,
0.2900712490081787,
-0.33203598856925964,
0.2798908650875091... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys - Syntax - Parameters:
None. | [
0.4783859848976135,
0.2902279794216156,
-1.3994078636169434,
-0.6379411816596985,
-0.4289871156215668,
-0.7038031816482544,
0.6821766495704651,
1.420411467552185,
-0.5800952911376953,
-0.3813997209072113,
-0.3986551761627197,
-0.6046767234802246,
-0.13624562323093414,
0.15536873042583466,
... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys - Syntax - Return value:
A new iterable iterator object. | [
0.23171894252300262,
-0.10044997185468674,
-1.0413720607757568,
-0.1734265238046646,
-0.3186687231063843,
-0.9610887765884399,
0.014290454797446728,
1.6514840126037598,
-0.25993311405181885,
0.3971359431743622,
-0.3651723265647888,
0.2184201031923294,
-0.332227498292923,
0.9302108883857727... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys - Description:
See `Array.prototype.keys()` for more details. This method is not generic and can only be called on typed array instances. | [
0.17733410000801086,
0.024457208812236786,
-0.9748700857162476,
0.2453254759311676,
-0.212877094745636,
-0.7178713083267212,
0.29035818576812744,
0.9550319910049438,
-0.5605530142784119,
0.11639026552438736,
-0.42066097259521484,
0.31534361839294434,
0.3483893871307373,
0.00821430142968893... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys - Examples - Iteration using for...of loop:
Example:
const arr = new Uint8Array([10, 20, 30, 40, 50]);
const arrKeys = arr.keys();
for (const n of arrKeys) {
console.log(n);
} | [
-0.007777533493936062,
-0.2849810719490051,
-0.5842348337173462,
0.8677206039428711,
-0.25013449788093567,
-0.897570788860321,
-0.10708100348711014,
0.2520829439163208,
-0.791620671749115,
0.3966022729873657,
0.7378008961677551,
0.5381062030792236,
-0.6815382242202759,
0.6653515100479126,
... |
javascript/reference/global_objects/typedarray/keys/index.md | JavaScript - Global Objects - TypedArray - keys - Examples - Alternative iteration:
Example:
const arr = new Uint8Array([10, 20, 30, 40, 50]);
const arrKeys = arr.keys();
console.log(arrKeys.next().value); // 0
console.log(arrKeys.next().value); // 1
console.log(arrKeys.next().value); // 2
console.log(arrKeys.next().... | [
0.08519932627677917,
-0.2570001482963562,
-0.7068235278129578,
0.3001548945903778,
0.016407715156674385,
-0.8278617858886719,
-0.44875940680503845,
0.43989500403404236,
-0.5712571740150452,
0.42650270462036133,
0.5006421804428101,
0.6130239963531494,
-0.41841787099838257,
0.349049866199493... |
javascript/reference/global_objects/typedarray/lastindexof/index.md | JavaScript - Global Objects - TypedArray - lastIndexOf:
The `lastIndexOf()` method of `TypedArray` instances returns the last index at which a given element can be found in the typed array, or -1 if it is not present. The typed array is searched backwards, starting at `fromIndex`. This method has the same algorithm as... | [
-0.4546799957752228,
-1.2334240674972534,
-0.7843791246414185,
0.29065006971359253,
-0.08326824009418488,
-0.3478817939758301,
0.42712047696113586,
0.5177046656608582,
-0.32146841287612915,
0.07279019802808762,
-0.12596698105335236,
0.14043080806732178,
0.017360271885991096,
0.808687090873... |
javascript/reference/global_objects/typedarray/lastindexof/index.md | JavaScript - Global Objects - TypedArray - lastIndexOf - Syntax:
Example:
lastIndexOf(searchElement)
lastIndexOf(searchElement, fromIndex) | [
-0.26342710852622986,
-0.39345717430114746,
-0.27714288234710693,
-0.3662395775318146,
-0.5946534872055054,
-1.0489189624786377,
-0.05055822804570198,
0.256194144487381,
-0.3678556978702545,
-0.5442774295806885,
-0.23337459564208984,
0.02249789610505104,
-0.0810873731970787,
0.122193194925... |
javascript/reference/global_objects/typedarray/lastindexof/index.md | JavaScript - Global Objects - TypedArray - lastIndexOf - Syntax - Parameters:
- `searchElement`: Element to locate in the typed array.
- `fromIndex` (optional): Zero-based index at which to start searching backwards, converted to an integer. | [
-0.054598286747932434,
-0.2486942559480667,
-0.4607740640640259,
0.26003560423851013,
-0.14079473912715912,
-0.44847726821899414,
0.7624781131744385,
0.34456878900527954,
-0.22606223821640015,
-0.22528810799121857,
-0.5934407114982605,
0.12342840433120728,
-0.6701807975769043,
0.2383962422... |
javascript/reference/global_objects/typedarray/lastindexof/index.md | JavaScript - Global Objects - TypedArray - lastIndexOf - Syntax - Return value:
The last index of `searchElement` in the typed array; `-1` if not found. | [
-0.6667665243148804,
-0.49581313133239746,
-0.4703332185745239,
0.05076116696000099,
-0.174457386136055,
-0.2868727147579193,
0.8684548139572144,
0.9006134271621704,
-0.40860962867736816,
-0.41729849576950073,
0.2042209655046463,
0.29740527272224426,
-0.4154726564884186,
0.4709993302822113... |
javascript/reference/global_objects/typedarray/lastindexof/index.md | JavaScript - Global Objects - TypedArray - lastIndexOf - Description:
See `Array.prototype.lastIndexOf()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.5051946043968201,
-0.24558968842029572,
-0.3901277482509613,
0.126041978597641,
-0.33777761459350586,
-0.4622722864151001,
0.1440153419971466,
0.5983492732048035,
-0.20767182111740112,
-0.1032155230641365,
-0.5762310028076172,
0.14595352113246918,
0.5454336404800415,
0.3735288083553314,... |
javascript/reference/global_objects/typedarray/lastindexof/index.md | JavaScript - Global Objects - TypedArray - lastIndexOf - Examples - Using lastIndexOf():
Example:
const uint8 = new Uint8Array([2, 5, 9, 2]);
uint8.lastIndexOf(2); // 3
uint8.lastIndexOf(7); // -1
uint8.lastIndexOf(2, 3); // 3
uint8.lastIndexOf(2, 2); // 0
uint8.lastIndexOf(2, -2); // 0
uint8.lastIndexOf(2, -1); // 3 | [
-0.36722466349601746,
-0.44946497678756714,
-0.7311818599700928,
0.2600938379764557,
-0.29976019263267517,
-0.753187894821167,
-0.5428895354270935,
0.3115314841270447,
-0.4500826597213745,
0.07483875751495361,
-0.45523807406425476,
0.5192081332206726,
0.21665823459625244,
0.427098453044891... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at:
The `at()` method of `TypedArray` instances takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the typed array. This method has the same algorithm as `Array.prototype.a... | [
0.031946610659360886,
-1.1249544620513916,
-1.0868464708328247,
0.380317360162735,
0.3063229024410248,
-0.7200635075569153,
-0.47608622908592224,
0.3513972759246826,
-0.7079808115959167,
0.8181920647621155,
0.04769754409790039,
0.5955373644828796,
-0.3296937048435211,
0.21648885309696198,
... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at - Syntax:
Example:
at(index) | [
0.5593047142028809,
-0.3051627278327942,
-1.1002702713012695,
-0.0982741191983223,
-0.7742549180984497,
-1.2010889053344727,
-0.18127800524234772,
0.5416280627250671,
-0.5124689340591431,
0.13395527005195618,
0.17087091505527496,
-0.2098856121301651,
-0.22108614444732666,
0.023774173110723... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at - Syntax - Parameters:
- `index`: Zero-based index of the typed array element to be returned, converted to an integer. Negative index counts back from the end of the typed array — if `index < 0`, `index + array.length` is accessed. | [
0.05914179980754852,
-0.27679944038391113,
-0.8239221572875977,
0.6975225210189819,
0.11177058517932892,
-0.7814112901687622,
0.4473765194416046,
1.0470972061157227,
-0.3880797326564789,
0.06175884231925011,
-0.9244716763496399,
0.35825470089912415,
0.028660763055086136,
0.2436494529247284... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at - Syntax - Return value:
The element in the typed array matching the given index. Always returns `undefined` if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. | [
-0.4718688726425171,
-0.3717079162597656,
-0.9821046590805054,
0.22966445982456207,
-0.5416088104248047,
-0.7710928320884705,
0.7663751840591431,
0.46986889839172363,
-0.5190218091011047,
-0.0063473256304860115,
-0.21295587718486786,
0.5632373690605164,
-0.3207870125770569,
0.7277632951736... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at - Description:
See `Array.prototype.at()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.05310362949967384,
-0.07010658830404282,
-0.533312201499939,
-0.05307817831635475,
-0.3582899570465088,
-0.7878214716911316,
-0.0015083127655088902,
0.5360750555992126,
-0.4832001328468323,
0.05826222896575928,
-0.15947185456752777,
0.05590067803859711,
0.39788344502449036,
-0.155321076... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at - Examples - Return the last value of a typed array:
The following example provides a function which returns the last element found in a specified array.
Example:
const uint8 = new Uint8Array([1, 2, 4, 7, 11, 18]);
// A function which returns the last item of a given ar... | [
0.19375105202198029,
-0.37412208318710327,
-1.3971883058547974,
-0.04552125185728073,
-0.590552806854248,
-0.8052475452423096,
-0.08118347823619843,
0.5715072751045227,
-0.8272031545639038,
0.2245180308818817,
0.6036465764045715,
0.5909546613693237,
-0.005458540748804808,
0.270868629217147... |
javascript/reference/global_objects/typedarray/at/index.md | JavaScript - Global Objects - TypedArray - at - Examples - Comparing methods:
Here we compare different ways to select the penultimate (last but one) item of a `TypedArray`. Whilst all below methods are valid, it highlights the succinctness and readability of the `at()` method.
Example:
// Our typed array with value... | [
-0.00723724439740181,
-0.40523380041122437,
-0.7844933867454529,
0.4345596432685852,
-0.4095746874809265,
-0.8206956386566162,
-0.17656640708446503,
0.1046072244644165,
-0.4692140221595764,
1.1513549089431763,
0.6830079555511475,
-0.2817925810813904,
0.021166514605283737,
-0.22606638073921... |
javascript/reference/global_objects/typedarray/bytelength/index.md | JavaScript - Global Objects - TypedArray - byteLength:
The `byteLength` accessor property of `TypedArray` instances returns the length (in bytes) of this typed array.
Example:
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer, 2);
console.log(uint8.... | [
-0.03847042843699455,
-0.5759234428405762,
-1.434456467628479,
0.6402077078819275,
-0.14277921617031097,
-0.7988781332969666,
-0.9001156091690063,
0.5688338279724121,
0.22285592555999756,
-0.027210718020796776,
-0.6385921239852905,
0.380024790763855,
-0.0259365476667881,
0.0297853220254182... |
javascript/reference/global_objects/typedarray/bytelength/index.md | JavaScript - Global Objects - TypedArray - byteLength - Description:
The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. If the typed array is length-tracking, then its length depends on the length of the underlying buffer, and may... | [
-1.0647637844085693,
-0.5962636470794678,
-0.9095779657363892,
0.6942033767700195,
0.13101635873317719,
-1.4800323247909546,
0.07403136789798737,
0.8270137310028076,
0.27556273341178894,
-0.3643520474433899,
-0.5400994420051575,
-0.056188248097896576,
-0.4259245991706848,
-0.05187806487083... |
javascript/reference/global_objects/typedarray/bytelength/index.md | JavaScript - Global Objects - TypedArray - byteLength - Examples - Using the byteLength property:
Example:
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.byteLength; // 8 (matches the byteLength of the buffer)
const uint8newLength = new Uint8Array(buffer, 1, 5);
uint8newLength.byteLe... | [
-0.0004027852264698595,
-0.37527793645858765,
-0.7930716872215271,
0.5496782064437866,
0.44571423530578613,
-1.0483741760253906,
0.3343092203140259,
0.5081329941749573,
-0.0044245547614991665,
0.2657598555088043,
-0.6924770474433899,
0.6306569576263428,
0.10774560272693634,
0.0836724638938... |
javascript/reference/global_objects/typedarray/tosorted/index.md | JavaScript - Global Objects - TypedArray - toSorted:
The `toSorted()` method of `TypedArray` instances is the copying version of the `sort()` method. It returns a new typed array with the elements sorted in ascending order. This method has the same algorithm as `Array.prototype.toSorted()`, except that it sorts the va... | [
-0.42942795157432556,
-0.5994564294815063,
-0.47876104712486267,
0.013543843291699886,
-0.03787398710846901,
-0.2721622586250305,
0.012272873893380165,
1.0920023918151855,
-0.2078644037246704,
0.42361417412757874,
-0.6899039149284363,
-0.21234731376171112,
-0.6666106581687927,
0.0834573805... |
javascript/reference/global_objects/typedarray/tosorted/index.md | JavaScript - Global Objects - TypedArray - toSorted - Syntax:
Example:
toSorted()
toSorted(compareFn) | [
0.027334298938512802,
-0.04189815744757652,
-0.23246432840824127,
-0.5357245802879333,
-0.7287778854370117,
-0.9966104626655579,
-0.3838079869747162,
0.9911499619483948,
-0.4051050543785095,
0.2815794348716736,
-0.5146275162696838,
0.10885073989629745,
-1.4190034866333008,
0.03568559885025... |
javascript/reference/global_objects/typedarray/tosorted/index.md | JavaScript - Global Objects - TypedArray - toSorted - Syntax - Parameters:
- `compareFn` (optional): A function that determines the order of the elements. If omitted, the typed array elements are sorted according to numeric value. See `sort()` for more information. | [
-0.08714137971401215,
-0.584232747554779,
-0.7372709512710571,
-0.3872177004814148,
-0.2664916515350342,
-0.6439129114151001,
-0.13643665611743927,
0.38870975375175476,
-0.1788327693939209,
0.6981120109558105,
-0.9905359745025635,
-0.12036498636007309,
-1.6376867294311523,
0.93884932994842... |
javascript/reference/global_objects/typedarray/tosorted/index.md | JavaScript - Global Objects - TypedArray - toSorted - Syntax - Return value:
A new typed array with the elements sorted in ascending order. | [
0.24288390576839447,
-0.3140951693058014,
-0.7087607383728027,
-0.09288354218006134,
-0.40658602118492126,
-0.5055403709411621,
-0.04521801695227623,
1.3164808750152588,
-0.25907278060913086,
0.3550534248352051,
-0.5150195360183716,
0.2556886672973633,
-1.0711082220077515,
0.76228231191635... |
javascript/reference/global_objects/typedarray/tosorted/index.md | JavaScript - Global Objects - TypedArray - toSorted - Description:
See `Array.prototype.toSorted()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.4141084849834442,
-0.13104775547981262,
-0.13002440333366394,
0.04113445430994034,
-0.35186904668807983,
-0.5866254568099976,
-0.3438568413257599,
1.0470963716506958,
-0.19661442935466766,
0.19569191336631775,
-0.6241476535797119,
-0.021187497302889824,
-0.3213444948196411,
-0.172085419... |
javascript/reference/global_objects/typedarray/tosorted/index.md | JavaScript - Global Objects - TypedArray - toSorted - Examples - Sorting an array:
For more examples, see also the `Array.prototype.sort()` method.
Example:
const numbers = new Uint8Array([40, 1, 5, 200]);
const numberSorted = numbers.toSorted();
console.log(numberSorted); // Uint8Array [ 1, 5, 40, 200 ]
// Unlike p... | [
-0.4386899173259735,
-0.5743083953857422,
-0.9199017286300659,
0.28507712483406067,
-0.26087820529937744,
-0.5196303725242615,
-1.0941698551177979,
0.8661963939666748,
-0.2932800352573395,
0.39042404294013977,
-0.07714525610208511,
0.25587064027786255,
-0.570388674736023,
0.075833290815353... |
javascript/reference/global_objects/typedarray/symbol.iterator/index.md | JavaScript - Global Objects - TypedArray - Symbol.iterator:
The `[Symbol.iterator]()` method of `TypedArray` instances implements the iterable protocol and allows typed arrays to be consumed by most syntaxes expecting iterables, such as the spread syntax and `for...of` loops. It returns an array iterator object that y... | [
-0.21831566095352173,
-0.4297775626182556,
-1.0712119340896606,
0.7947313785552979,
0.33515581488609314,
-1.1112289428710938,
-0.9062588214874268,
1.4890342950820923,
-0.41403141617774963,
0.5087968707084656,
-0.22780655324459076,
1.065118432044983,
-0.28160321712493896,
0.0028486007358878... |
javascript/reference/global_objects/typedarray/symbol.iterator/index.md | JavaScript - Global Objects - TypedArray - Symbol.iterator - Syntax:
Example:
typedArray[Symbol.iterator]() | [
0.36922597885131836,
0.14148347079753876,
-0.37442389130592346,
-0.21348275244235992,
-0.34364134073257446,
-1.5493987798690796,
-0.519642174243927,
1.295935034751892,
0.2592386305332184,
-0.30119454860687256,
0.10550420731306076,
0.636624813079834,
-0.39804697036743164,
-0.088488981127738... |
javascript/reference/global_objects/typedarray/symbol.iterator/index.md | JavaScript - Global Objects - TypedArray - Symbol.iterator - Syntax - Parameters:
None. | [
0.2516511082649231,
0.26881274580955505,
-0.7268136143684387,
-0.4943406283855438,
-0.26250237226486206,
-1.2260888814926147,
-0.3239158093929291,
1.5987129211425781,
-0.3082047402858734,
-0.41295695304870605,
-0.3869290053844452,
0.09054592996835709,
-0.08358313143253326,
0.09624695032835... |
javascript/reference/global_objects/typedarray/symbol.iterator/index.md | JavaScript - Global Objects - TypedArray - Symbol.iterator - Syntax - Return value:
The same return value as `TypedArray.prototype.values()`: a new iterable iterator object that yields the value of each index in the typed array. | [
-0.3082144260406494,
-0.2694847583770752,
-0.6808490753173828,
0.23845995962619781,
-0.12531691789627075,
-0.9172356128692627,
-0.3495688736438751,
1.5812013149261475,
-0.31312042474746704,
0.23605091869831085,
-0.12008874118328094,
0.7469697594642639,
-0.21451719105243683,
0.5073714852333... |
javascript/reference/global_objects/typedarray/symbol.iterator/index.md | JavaScript - Global Objects - TypedArray - Symbol.iterator - Examples - Iteration using for...of loop:
Note that you seldom need to call this method directly. The existence of the `[Symbol.iterator]()` method makes typed arrays iterable, and iterating syntaxes like the `for...of` loop automatically call this method to... | [
-0.1714223027229309,
-0.003856161143630743,
-0.2013813704252243,
0.8918180465698242,
0.207012340426445,
-1.7212421894073486,
-0.7086904048919678,
0.8094854950904846,
-0.845288097858429,
0.3920673131942749,
0.3821471333503723,
0.43299490213394165,
-0.7116040587425232,
0.5504063367843628,
... |
javascript/reference/global_objects/typedarray/symbol.iterator/index.md | JavaScript - Global Objects - TypedArray - Symbol.iterator - Examples - Manually hand-rolling the iterator:
You may still manually call the `next()` method of the returned iterator object to achieve maximum control over the iteration process.
Example:
const arr = new Uint8Array([10, 20, 30, 40, 50]);
const arrIter =... | [
-0.34284818172454834,
-0.07841543108224869,
-0.8073473572731018,
0.4288646876811981,
-0.06155279651284218,
-1.2266916036605835,
-0.731580913066864,
0.9697422981262207,
-0.5546603202819824,
0.9395307898521423,
0.21420548856258392,
0.9595574736595154,
-0.263083279132843,
0.2789579927921295,
... |
javascript/reference/global_objects/typedarray/subarray/index.md | JavaScript - Global Objects - TypedArray - subarray:
The `subarray()` method of `TypedArray` instances returns a new typed array on the same `ArrayBuffer` store and with the same element types as for this typed array. The begin offset is inclusive and the end offset is exclusive.
Example:
const uint8 = new Uint8Arra... | [
-0.5626230835914612,
-0.7892126441001892,
-1.838608741760254,
0.4575485289096832,
-0.0943944901227951,
-0.3986879587173462,
-0.16198496520519257,
1.274509310722351,
-0.14959301054477692,
0.45284566283226013,
-0.0077744596637785435,
0.859520435333252,
0.22242476046085358,
0.1720790714025497... |
javascript/reference/global_objects/typedarray/subarray/index.md | JavaScript - Global Objects - TypedArray - subarray - Syntax:
Example:
subarray()
subarray(begin)
subarray(begin, end) | [
0.346697062253952,
0.36277085542678833,
-1.0538547039031982,
-0.39378371834754944,
-0.7236441373825073,
-0.7021651268005371,
0.0596371628344059,
1.6039507389068604,
0.06469251960515976,
-0.17593514919281006,
-0.3334577679634094,
0.32443228363990784,
0.09076162427663803,
-0.2452068626880645... |
javascript/reference/global_objects/typedarray/subarray/index.md | JavaScript - Global Objects - TypedArray - subarray - Syntax - Parameters:
- `begin` (optional): Element to begin at. The offset is inclusive. The whole array will be included in the new view if this value is not specified.
- `end` (optional): Element to end at. The offset is exclusive. If not specified, all elements ... | [
0.06141955778002739,
-0.24775096774101257,
-1.0625187158584595,
0.023729123175144196,
-0.1958528757095337,
-1.2979909181594849,
0.7897961139678955,
0.6685922145843506,
0.5131773352622986,
0.15740644931793213,
-0.4082694351673126,
0.4899684488773346,
-0.09349647164344788,
0.2640736997127533... |
javascript/reference/global_objects/typedarray/subarray/index.md | JavaScript - Global Objects - TypedArray - subarray - Syntax - Return value:
A new `TypedArray` object. | [
0.17170943319797516,
-0.30161547660827637,
-1.198216438293457,
-0.39173054695129395,
-0.4573853313922882,
-0.35716164112091064,
0.1319950819015503,
1.6743308305740356,
0.23807121813297272,
0.18198072910308838,
0.023164378479123116,
0.23263970017433167,
-0.025272967293858528,
0.528761804103... |
javascript/reference/global_objects/typedarray/subarray/index.md | JavaScript - Global Objects - TypedArray - subarray - Description:
The range specified by `begin` and `end` is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either `begin` or `end` is negative, it refers to an index from the ... | [
-0.9917259812355042,
-0.24009519815444946,
-1.1687508821487427,
-0.08282322436571121,
0.039618488401174545,
-1.3950005769729614,
0.09574960917234421,
0.8880282044410706,
-0.2880531847476959,
0.06371647119522095,
-0.9306403398513794,
0.4594978392124176,
-0.3261515498161316,
0.24069824814796... |
javascript/reference/global_objects/typedarray/subarray/index.md | JavaScript - Global Objects - TypedArray - subarray - Examples - Using the subarray() method:
Example:
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.set([1, 2, 3]);
console.log(uint8); // Uint8Array [ 1, 2, 3, 0, 0, 0, 0, 0 ]
const sub = uint8.subarray(0, 4);
console.log(sub); // U... | [
-0.6373912692070007,
-0.2987616956233978,
-1.7618529796600342,
0.5057730078697205,
-0.1178177148103714,
-0.8636722564697266,
-0.44618168473243713,
0.6001784801483154,
-0.23129038512706757,
0.4543784558773041,
-0.40740638971328735,
0.5235813856124878,
0.688438892364502,
-0.10251221805810928... |
javascript/reference/global_objects/typedarray/tolocalestring/index.md | JavaScript - Global Objects - TypedArray - toLocaleString:
The `toLocaleString()` method of `TypedArray` instances returns a string representing the elements of the typed array. The elements are converted to strings using their `toLocaleString` methods and these strings are separated by a locale-specific string (such ... | [
-0.2321198284626007,
-0.250400573015213,
-0.7516894936561584,
0.5661177635192871,
0.13520891964435577,
-0.909763514995575,
-0.5210476517677307,
0.5579948425292969,
-0.03702830150723457,
0.06329462677240372,
0.1960577815771103,
0.798142671585083,
-0.19436554610729218,
-0.04178168252110481,
... |
javascript/reference/global_objects/typedarray/tolocalestring/index.md | JavaScript - Global Objects - TypedArray - toLocaleString - Syntax:
Example:
toLocaleString()
toLocaleString(locales)
toLocaleString(locales, options) | [
-0.22889481484889984,
0.7116057276725769,
-0.09476277977228165,
0.07200366258621216,
-0.34717223048210144,
-1.8239539861679077,
0.24961167573928833,
0.43828126788139343,
0.0010234747314825654,
-0.586277961730957,
0.26374295353889465,
0.15652184188365936,
0.09076905250549316,
-0.41842290759... |
javascript/reference/global_objects/typedarray/tolocalestring/index.md | JavaScript - Global Objects - TypedArray - toLocaleString - Syntax - Parameters:
- `locales` (optional): A string with a `BCP 47 language tag`, or an array of such strings. For the general form and interpretation of the `locales` argument, see the parameter description on the `Intl` main page.
- `options` (optional): ... | [
-0.8816120028495789,
0.16715353727340698,
-0.5095765590667725,
0.06917985528707504,
-0.17354349792003632,
-2.172837495803833,
1.0011358261108398,
0.03335867449641228,
0.387397825717926,
-0.0677095502614975,
-0.5126996040344238,
0.6067855954170227,
0.22737163305282593,
0.15372325479984283,
... |
javascript/reference/global_objects/typedarray/tolocalestring/index.md | JavaScript - Global Objects - TypedArray - toLocaleString - Syntax - Return value:
A string representing the elements of the typed array. | [
-0.025612428784370422,
0.018415577709674835,
-0.4224766790866852,
0.013257442973554134,
-0.3241691589355469,
-1.6438032388687134,
0.4531853497028351,
0.8444532155990601,
-0.3072358965873718,
-0.07014026492834091,
-0.25251346826553345,
0.9451590180397034,
-0.8725339770317078,
0.540306210517... |
javascript/reference/global_objects/typedarray/tolocalestring/index.md | JavaScript - Global Objects - TypedArray - toLocaleString - Description:
See `Array.prototype.toLocaleString()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.34630537033081055,
0.3885555565357208,
-0.11220317333936691,
0.14690876007080078,
0.12254863232374191,
-1.2754502296447754,
0.03664516657590866,
0.5135696530342102,
-0.15048198401927948,
-0.28165310621261597,
-0.4129021465778351,
0.33105963468551636,
0.1683279424905777,
-0.3831200599670... |
javascript/reference/global_objects/typedarray/tolocalestring/index.md | JavaScript - Global Objects - TypedArray - toLocaleString - Examples - Using toLocaleString():
Example:
const uint = new Uint32Array([2000, 500, 8123, 12, 4212]);
uint.toLocaleString();
// if run in a de-DE locale
// "2.000,500,8.123,12,4.212"
uint.toLocaleString("en-US");
// "2,000,500,8,123,12,4,212"
uint.toLoca... | [
-0.9754883050918579,
0.15844328701496124,
-1.005609393119812,
0.9017192721366882,
0.016503356397151947,
-0.7031844854354858,
-0.9608554244041443,
-0.17890973389148712,
-0.4832444190979004,
-0.3235255181789398,
0.00900306086987257,
0.6064755320549011,
-0.01965746283531189,
-0.01363852620124... |
javascript/reference/global_objects/typedarray/reduceright/index.md | JavaScript - Global Objects - TypedArray - reduceRight:
The `reduceRight()` method of `TypedArray` instances applies a function against an accumulator and each value of the typed array (from right-to-left) to reduce it to a single value. This method has the same algorithm as `Array.prototype.reduceRight()`.
Example:
... | [
-0.3263932764530182,
-0.23770183324813843,
-0.2740970253944397,
0.5078794956207275,
0.26718252897262573,
-0.9221222400665283,
-0.3716672360897064,
0.8569623231887817,
-0.025306422263383865,
-0.01029658317565918,
-0.4401634633541107,
-0.3330989480018616,
0.054456956684589386,
0.147797346115... |
javascript/reference/global_objects/typedarray/reduceright/index.md | JavaScript - Global Objects - TypedArray - reduceRight - Syntax:
Example:
reduceRight(callbackFn)
reduceRight(callbackFn, initialValue) | [
-0.2461249679327011,
0.7702810764312744,
-0.0016527227126061916,
0.18004877865314484,
-1.3198397159576416,
-1.8948692083358765,
0.998392641544342,
0.777254581451416,
-0.12569834291934967,
0.44376257061958313,
-1.0131911039352417,
-0.6076216697692871,
-0.8411980867385864,
0.4047348201274872... |
javascript/reference/global_objects/typedarray/reduceright/index.md | JavaScript - Global Objects - TypedArray - reduceRight - Syntax - Parameters:
- `callbackFn`: A function to execute for each element in the typed array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return... | [
0.36295434832572937,
-0.1534063071012497,
-0.5961235761642456,
0.10033564269542694,
0.4937971830368042,
0.07719869911670685,
0.4535595774650574,
0.4445057809352875,
-0.2537553906440735,
0.015567363239824772,
-0.22223679721355438,
-0.06478869915008545,
-0.6743183732032776,
0.801261723041534... |
javascript/reference/global_objects/typedarray/reduceright/index.md | JavaScript - Global Objects - TypedArray - reduceRight - Syntax - Return value:
The value that results from the reduction. | [
-0.059508536010980606,
0.11100844293832779,
-0.5852583050727844,
-0.11509884148836136,
-0.7927819490432739,
-1.2910842895507812,
0.36465343832969666,
1.2623292207717896,
0.3905682861804962,
0.24024541676044464,
-1.236894965171814,
0.21272516250610352,
-0.9763253331184387,
1.048047900199890... |
javascript/reference/global_objects/typedarray/reduceright/index.md | JavaScript - Global Objects - TypedArray - reduceRight - Description:
See `Array.prototype.reduceRight()` for more details. This method is not generic and can only be called on typed array instances. | [
-0.6154857873916626,
0.12165290117263794,
0.06866417080163956,
0.4455239176750183,
-0.6098802089691162,
-1.372206687927246,
0.31159502267837524,
1.1001955270767212,
0.2943997383117676,
0.26284506916999817,
-1.1906828880310059,
-0.24571743607521057,
0.13406887650489807,
-0.23943790793418884... |
javascript/reference/global_objects/typedarray/reduceright/index.md | JavaScript - Global Objects - TypedArray - reduceRight - Examples - Sum up all values within an array:
Example:
const total = new Uint8Array([0, 1, 2, 3]).reduceRight((a, b) => a + b);
// total === 6 | [
-0.12214788794517517,
0.05332886055111885,
-0.7913564443588257,
0.120737724006176,
-0.7535775303840637,
-1.268375277519226,
-0.45357513427734375,
0.689563512802124,
0.14805921912193298,
0.08352568000555038,
-0.866590678691864,
0.4429475665092468,
0.1462189108133316,
-0.24426701664924622,
... |
javascript/reference/global_objects/typedarray/map/index.md | JavaScript - Global Objects - TypedArray - map:
The `map()` method of `TypedArray` instances creates a new typed array populated with the results of calling a provided function on every element in the calling typed array. This method has the same algorithm as `Array.prototype.map()`.
Example:
const uint8 = new Uint8... | [
0.25708919763565063,
-0.9607402086257935,
-1.3811686038970947,
0.5218027830123901,
0.04907437786459923,
-0.9550485610961914,
-0.4973762035369873,
0.6391415596008301,
-0.6466583013534546,
0.8199931383132935,
-0.18227127194404602,
0.4472999572753906,
0.30285221338272095,
0.17401628196239471,... |
javascript/reference/global_objects/typedarray/map/index.md | JavaScript - Global Objects - TypedArray - map - Syntax:
Example:
map(callbackFn)
map(callbackFn, thisArg) | [
0.08816248178482056,
0.40943974256515503,
-0.5886231064796448,
-0.3091389834880829,
-0.7912033200263977,
-1.7726831436157227,
1.0594840049743652,
0.8994959592819214,
-0.7662093043327332,
0.16482536494731903,
-0.27256202697753906,
0.4559357762336731,
-0.3159903883934021,
0.7032530903816223,... |
javascript/reference/global_objects/typedarray/map/index.md | JavaScript - Global Objects - TypedArray - map - Syntax - Parameters:
- `callbackFn`: A function to execute for each element in the typed array. Its return value is added as a single element in the new typed array. The function is called with the following arguments:
- `element`: The current element being processed ... | [
-0.11878766864538193,
-0.16098803281784058,
-1.3034065961837769,
0.2715323269367218,
-0.2902580201625824,
-1.3603384494781494,
1.2918188571929932,
0.563753604888916,
-0.7715219855308533,
0.5699241161346436,
-0.5889583826065063,
0.39726775884628296,
-0.893496572971344,
1.4653247594833374,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.