file
stringlengths
16
94
text
stringlengths
32
24.4k
vector
list
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Syntax - Parameters: - `callbackFn`: A function to execute for each element in the array. Its return value is added as a single element in the new array. The function is called with the following arguments: - `element`: The current element being processed in the array. -...
[ -0.43730857968330383, -0.034337811172008514, -1.1323187351226807, 0.2696826756000519, -0.4615234434604645, -2.024832248687744, 1.4179812669754028, 0.4157782196998596, -0.8251139521598816, 0.48058807849884033, -0.6993790864944458, 0.6435969471931458, -0.7172703742980957, 1.6916333436965942,...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Syntax - Return value: A new array with each element being the result of the callback function.
[ 0.17551060020923615, -0.40451326966285706, -1.5233765840530396, -0.21420113742351532, -0.7272756099700928, -1.526423454284668, 0.6047323346138, 0.8635956645011902, -0.4050734043121338, 0.06834365427494049, -0.3978550136089325, 0.8822557330131531, 0.34672558307647705, 1.0460411310195923, ...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Description: The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. Read the iterative methods section for more information about how these methods work in general. ...
[ -0.9453260898590088, -0.3483881652355194, -1.0182439088821411, 0.4235812723636627, 0.13082236051559448, -1.8935497999191284, 1.0782021284103394, 0.11823076009750366, -1.4026148319244385, 1.166966438293457, -0.4330275058746338, 0.7149533033370972, 0.12211349606513977, 0.9758762121200562, ...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Mapping an array of numbers to an array of square roots: The following code takes an array of numbers and creates a new array containing the square roots of the numbers in the first array. Example: const numbers = [1, 4, 9]; const roots = numbers.map((num) => Ma...
[ 0.12187115848064423, 0.3728133738040924, -1.0129554271697998, -0.148619145154953, -0.12139156460762024, -1.6459636688232422, 0.5680528879165649, -0.0008442588150501251, -0.2643756866455078, -0.09084805846214294, -0.47979244589805603, 0.554179310798645, -0.5492595434188843, -0.3374239802360...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Using map to reformat objects in an array: The following code takes an array of objects and creates a new array containing the newly reformatted objects. Example: const kvArray = [ { key: 1, value: 10 }, { key: 2, value: 20 }, { key: 3, value: 30 }, ]; co...
[ 0.27523568272590637, 0.3027275502681732, -1.480201244354248, 0.15534158051013947, -0.11298122256994247, -1.6133447885513306, 0.5699655413627625, 0.6348381638526917, -0.08710278570652008, 0.5495706796646118, 0.7356024384498596, 0.8058530688285828, -0.48780927062034607, 0.44261783361434937, ...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Using parseInt() with map(): It is common to use the callback with one argument (the element being traversed). Certain functions are also commonly used with one argument, even though they take additional optional arguments. These habits may lead to confusing behav...
[ -0.15302416682243347, -0.14369416236877441, -1.0187275409698486, 0.7579811811447144, 0.7337964773178101, -1.2164360284805298, 0.22377866506576538, -0.1580633819103241, -0.1972518265247345, 0.12167380005121231, -0.38655760884284973, -0.2172572910785675, 0.2667706608772278, 0.454148530960083...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Mapped array contains undefined: When `undefined` or nothing is returned, the resulting array contains `undefined`. If you want to delete the element instead, chain a `filter()` method, or use the `flatMap()` method and return an empty array to signify deletion. ...
[ -0.8194774985313416, -0.4587193727493286, -0.9745426774024963, -0.1399175077676773, 0.3045530915260315, -2.0161983966827393, 0.9719264507293701, 0.2755206227302551, -1.0299415588378906, 0.9900091290473938, 0.027776367962360382, 0.3646096885204315, -0.2303609997034073, 0.1211063414812088, ...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Side-effectful mapping: The callback can have side effects. Example: const cart = [5, 15, 25]; let total = 0; const withTax = cart.map((cost) => { total += cost; return cost * 1.2; }); console.log(withTax); // [6, 18, 30] console.log(total); // 45 This is n...
[ -0.28775134682655334, -0.21730008721351624, -1.3437676429748535, 0.3861730992794037, 0.19075730443000793, -1.2389146089553833, 0.7502985000610352, 0.7361780405044556, -0.8739446401596069, 1.3021674156188965, -0.4227486848831177, 1.1705340147018433, -0.0032766200602054596, -0.14882570505142...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - 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 posi...
[ 0.012832061387598515, 0.21273894608020782, -1.2674468755722046, 0.037340134382247925, -0.37712275981903076, -1.8099037408828735, 0.7671518921852112, -0.381084680557251, -0.7199996709823608, 0.9122264981269836, -0.56669682264328, 0.7017927169799805, -0.5010329484939575, 0.6473237872123718, ...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Using map() on sparse arrays: A sparse array remains sparse after `map()`. The indices of empty slots are still empty in the returned array, and the callback function won't be called on them. Example: console.log( [1, , 3].map((x, index) => { console.log(`...
[ -0.8572761416435242, 0.2715757489204407, -0.821082353591919, 0.4325306713581085, 0.11758601665496826, -1.7040443420410156, 1.2017371654510498, -0.05689762160181999, -1.091260313987732, 0.5885522365570068, 0.4311487078666687, 0.5916077494621277, 0.7040174603462219, 0.3250828683376312, 0.2...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Examples - Calling map() on non-array objects: The `map()` 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: 5, // ignor...
[ -0.5415228605270386, 0.46130964159965515, -0.44196659326553345, 0.793138325214386, 0.40863609313964844, -1.2939146757125854, 0.5181910991668701, 0.2770645320415497, -0.6739330291748047, 0.7481032013893127, -0.2994552254676819, 0.3306522071361542, 0.4081036150455475, 0.2989589273929596, 0...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join: The `join()` method of `Array` instances returns a new string that is the concatenation of all elements in this array, separated by commas or a specified separator string. If the array has only one item, that item's stringification is returned without using the separator. E...
[ 0.3497740924358368, -0.7766736149787903, -1.4184386730194092, 0.29493412375450134, -0.3482567369937897, -2.003816604614258, 0.4849274754524231, 0.4637962877750397, -0.4260382056236267, 0.8253287076950073, 0.09763270616531372, -0.3910563886165619, -0.147711381316185, 0.24504753947257996, ...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Syntax: Example: join() join(separator)
[ 0.8502086400985718, -0.005937386304140091, -1.4611634016036987, -0.3383248448371887, -0.9513087868690491, -1.9924815893173218, 0.7565137147903442, 0.5355767607688904, -0.6831590533256531, 0.15776126086711884, -0.658534586429596, 0.23143428564071655, -0.20758192241191864, 0.1627890616655349...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Syntax - Parameters: - `separator` (optional): A string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (",").
[ -0.14583149552345276, -0.20284748077392578, -1.1371911764144897, 0.07192838191986084, 0.002508789300918579, -2.0653891563415527, 0.1969173550605774, 0.3808123767375946, -0.4540920853614807, 0.4697021543979645, -0.7699446678161621, 0.38928303122520447, -0.69190514087677, 0.516677737236023, ...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Syntax - Return value: A string with all array elements joined. If `array.length` is `0`, the empty string is returned.
[ -0.17971991002559662, -0.002700040116906166, -0.7338303327560425, -0.01951543241739273, -0.5182766914367676, -1.8217114210128784, 1.344910740852356, 0.6461243033409119, -0.7936384677886963, 0.38381966948509216, -0.7661436200141907, 0.5767030119895935, -0.24116143584251404, 0.81449836492538...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Description: The string conversions of all array elements are joined into one string. If an element is `undefined` or `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. The `join` method is accessed internally by `Array.prototype.to...
[ 0.030723795294761658, 0.2008291631937027, -1.2547905445098877, 0.392160564661026, -0.12991061806678772, -1.311516523361206, 1.2836517095565796, 0.3142622113227844, -0.6851012706756592, 0.8805612921714783, -0.5153759121894836, -0.02013707533478737, -0.21101030707359314, 0.2635389566421509, ...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Examples - Joining an array four different ways: The following example creates an array, `a`, with three elements, then joins the array four times: using the default separator, then a comma and a space, then a plus and an empty string. Example: const a = ["Wind", "Water",...
[ 0.4676048755645752, 0.8785507082939148, -0.8216801881790161, 0.25021788477897644, -0.48690637946128845, -1.524031400680542, 0.6242913603782654, -0.1622323989868164, -0.26587802171707153, 0.5402228236198425, -0.14495261013507843, -0.008274972438812256, -0.3292918801307678, -0.21338252723217...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Examples - Using join() on sparse arrays: `join()` treats empty slots the same as `undefined` and produces an extra separator: Example: console.log([1, , 3].join()); // '1,,3' console.log([1, undefined, 3].join()); // '1,,3'
[ -0.10950084775686264, 0.2730189561843872, -1.5741276741027832, 0.9222812056541443, -0.04608593136072159, -0.9671506285667419, 1.6120967864990234, 0.10834269225597382, -1.1167092323303223, 0.8836632370948792, -0.0477963462471962, 0.13268594443798065, 0.1483192890882492, -0.2677310109138489,...
javascript/reference/global_objects/array/join/index.md
JavaScript - Global Objects - Array - join - Examples - Calling join() on non-array objects: The `join()` 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: 5, // ig...
[ -0.4416140019893646, 0.1546560674905777, -0.9953628182411194, 0.5623558759689331, -0.23654431104660034, -1.0962077379226685, 0.9921553134918213, -0.27870380878448486, -1.219631314277649, 0.4544333517551422, -0.694567859172821, -0.008529536426067352, -0.16014748811721802, 0.0763434022665023...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push: The `push()` method of `Array` instances adds the specified elements to the end of an array and returns the new length of the array. Example: const animals = ["pigs", "goats", "sheep"]; const count = animals.push("cows"); console.log(count); // Expected output: 4 console....
[ -0.16792011260986328, -0.9188225865364075, -1.476138710975647, 0.9011882543563843, -0.3085326552391052, -1.245469093322754, 0.28891921043395996, 0.6918574571609497, -0.5717329978942871, 0.505518913269043, -0.5253786444664001, 0.7432208061218262, -0.09256131947040558, 0.8121499419212341, ...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Syntax: Example: push() push(element1) push(element1, element2) push(element1, element2, /* …, */ elementN)
[ -0.07167574018239975, 0.3154233992099762, -0.19836196303367615, -0.387160986661911, -1.0812679529190063, -1.789807677268982, 0.5598748326301575, 1.2596834897994995, -0.18473558127880096, -0.3160460889339447, -0.2620088458061218, 0.6152567267417908, -0.5563852787017822, -0.184036523103714, ...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Syntax - Parameters: - `element1`, …, `elementN`: The element(s) to add to the end of the array.
[ 0.11736660450696945, 0.08742047101259232, -0.2993343770503998, -0.4097408950328827, -0.8586162328720093, -2.108604669570923, 0.7172571420669556, 0.6425962448120117, -0.20864646136760712, -0.024901211261749268, -0.4854988753795624, 0.7998833060264587, -0.5534988641738892, 0.6530158519744873...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Syntax - Return value: The new `length` property of the object upon which the method was called.
[ -0.6836591362953186, -0.35581451654434204, -0.8253127932548523, 0.033481404185295105, -0.5304526090621948, -1.4670547246932983, 0.16310803592205048, 1.2525641918182373, -0.014295190572738647, -0.3774823546409607, -0.9623718857765198, 1.0623506307601929, 0.14600889384746552, 1.0299646854400...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Description: The `push()` method appends values to an array. `Array.prototype.unshift()` has similar behavior to `push()`, but applied to the start of an array. The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the...
[ -0.7284526824951172, -0.08367165923118591, -0.8468409776687622, 0.4330379068851471, -0.377654492855072, -1.52415132522583, 1.1226427555084229, 1.107711911201477, -0.4910818934440613, 0.22219038009643555, -0.7229452133178711, 0.8602787852287292, -0.18129752576351166, 0.05335898697376251, ...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Examples - Adding elements to an array: The following code creates the `sports` array containing two elements, then appends two elements to it. The `total` variable contains the new length of the array. Example: const sports = ["soccer", "baseball"]; const total = sports....
[ -0.2001975178718567, -0.2788836658000946, -1.459448218345642, 0.7212486863136292, -0.3529272675514221, -1.3200757503509521, 0.1900123953819275, 0.41394945979118347, 0.27133098244667053, -0.35716864466667175, -0.20249292254447937, 1.208183765411377, -0.5355332493782043, 0.13592083752155304,...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Examples - Merging two arrays: This example uses `spread syntax` to push all elements from a second array into the first one. Example: const vegetables = ["parsnip", "potato"]; const moreVegs = ["celery", "beetroot"]; // Merge the second array into the first one vegetabl...
[ -0.30311495065689087, -0.3753434717655182, -1.107940435409546, 1.1519660949707031, -0.30665451288223267, -0.9040635228157043, 0.4431082308292389, 0.7557817697525024, -0.4412577748298645, 0.2860168218612671, -0.7368781566619873, 0.7265155911445618, -0.3123150169849396, 0.04460009187459946, ...
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Examples - Calling push() on non-array objects: The `push()` method reads the `length` property of `this`. It then sets each index of `this` starting at `length` with the arguments passed to `push()`. Finally, it sets the `length` to the previous length plus the number of p...
[ -1.3076297044754028, 0.13019244372844696, -0.862580418586731, 0.6450455188751221, -0.2693614363670349, -0.7271881103515625, 0.32664740085601807, 0.384793758392334, -0.3018842935562134, 0.3575953543186188, -0.6341118216514587, 0.8067666888237, 0.21728479862213135, 0.11242859065532684, -0....
javascript/reference/global_objects/array/push/index.md
JavaScript - Global Objects - Array - push - Examples - Using an object in an array-like fashion: As mentioned above, `push` is intentionally generic, and we can use that to our advantage. `Array.prototype.push` can work on an object just fine, as this example shows. Note that we don't create an array to store a coll...
[ 0.1744593232870102, 0.7049199342727661, -0.4430754482746124, 0.8611071109771729, 0.4513320326805115, -0.5018649697303772, -0.21559539437294006, 0.5460991263389587, -0.008218608796596527, 0.08251100033521652, -0.7912877202033997, 0.17553657293319702, -0.17605793476104736, 0.6127898693084717...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format: The `format()` method of `Intl.NumberFormat` instances formats a number according to the locale and formatting options of this `Intl.NumberFormat` object. Example: const amount = 654321.987; const options1 = { style: "currency", currency: "RUB" }; const nu...
[ -0.35827741026878357, -0.1453997641801834, -0.6338985562324524, 0.04066196084022522, -0.6386236548423767, -0.10969477146863937, -0.3620544970035553, 0.4044198989868164, 0.15204623341560364, 0.018411584198474884, -0.36568135023117065, 0.16176478564739227, 0.04251348227262497, 0.026211455464...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Syntax: Example: format(number)
[ -0.4498459994792938, 0.210662379860878, -0.9483462572097778, -0.8713706135749817, -0.9885949492454529, -1.2485476732254028, 0.6788106560707092, 0.9746437072753906, -0.1984913945198059, -0.44022873044013977, -0.5030994415283203, 0.19929921627044678, -0.5348677635192871, 0.1408425271511078, ...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Syntax - Parameters: - `number`: A `Number`, `BigInt`, or string, to format. Strings are parsed in the same way as in number conversion, except that `format()` will use the exact value that the string represents, avoiding loss of precision during implicitly ...
[ -1.3202929496765137, -0.12604951858520508, -1.1162657737731934, -0.5040656328201294, -0.09634072333574295, -2.044365882873535, 0.3892095685005188, 0.13784700632095337, 0.18002992868423462, 0.09300487488508224, -0.8928626179695129, 0.1749613881111145, -0.6665984392166138, 0.5945906043052673...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Syntax - Return value: A string representing the given `number` formatted according to the locale and formatting options of this `Intl.NumberFormat` object. Note: Most of the time, the formatting returned by `format()` is consistent. However, the output may...
[ -1.392682671546936, 0.054761797189712524, -0.5451894402503967, -0.4142295718193054, -0.32555702328681946, -1.534887671470642, 0.989037275314331, 0.5121824741363525, -0.18751315772533417, 0.4937698543071747, -0.37308934330940247, 0.8370669484138489, -0.30248022079467773, 0.5731260776519775,...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Description: `Number` values in JavaScript suffer from loss of precision if they are too big or too small, making the text representation inaccurate. If you are performing calculations with integers larger than `Number.MAX_SAFE_INTEGER` you should use a `Big...
[ -1.117842435836792, -0.20383433997631073, -1.2183626890182495, -0.15137355029582977, -0.14298540353775024, -1.6140966415405273, 0.4617316424846649, -0.27576565742492676, -1.3279532194137573, -0.13137324154376984, -0.6693540215492249, 0.053192250430583954, -0.8341526389122009, -0.3881315290...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Examples - Using format: Use the `format` getter function for formatting a single currency value. The code below shows how to format the roubles currency for a Russian locale: Example: const options = { style: "currency", currency: "RUB" }; const numberFor...
[ -0.8158072233200073, 0.061222389340400696, -0.7751431465148926, -0.2479419708251953, -0.7151861190795898, 0.03771321475505829, 0.299674928188324, 1.0568269491195679, 0.16113123297691345, -0.34618356823921204, -0.2668062448501587, 0.39848482608795166, -0.0034117698669433594, -0.230219334363...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Examples - Using format with map: Use the `format` getter function for formatting all numbers in an array. Note that the function is bound to the `Intl.NumberFormat` from which it was obtained, so it can be passed directly to `Array.prototype.map`. This is c...
[ -0.5037165284156799, -0.21488232910633087, -1.0246021747589111, -0.07200472056865692, -0.21837154030799866, -1.5498899221420288, 0.2739624083042145, 0.05033036321401596, -0.04751747101545334, 0.29181304574012756, -0.41822549700737, 0.7961881160736084, 0.011921882629394531, 0.43440523743629...
javascript/reference/global_objects/intl/numberformat/format/index.md
JavaScript - Global Objects - Intl - NumberFormat - format - Examples - Using format with a string: Using a string we can specify numbers that are larger than `Number.MAX_SAFE_INTEGER` without losing precision. Example: const numberFormat = new Intl.NumberFormat("en-US"); // Here the value is converted to a Number ...
[ -0.24082916975021362, -0.41031724214553833, -0.3158734440803528, 0.30475664138793945, 0.10525310039520264, -1.0285520553588867, 0.8762112259864807, 0.644237756729126, -0.9471303224563599, 0.2426493614912033, -0.9371873736381531, -0.45834192633628845, -0.8022608160972595, 0.1260477304458618...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator: An `Iterator` object is an object that conforms to the iterator protocol by providing a `next()` method that returns an iterator result object. All built-in iterators inherit from the `Iterator` class. The `Iterator` class provides a `[Symbol.iterator]()` method that returns the...
[ -0.9518243074417114, -0.36118993163108826, -0.6436389684677124, 0.3915484547615051, 0.17698439955711365, -1.9022589921951294, -0.6217353940010071, 0.8330349326133728, -0.5655088424682617, -0.01121475175023079, -0.6315779089927673, 0.20398485660552979, -0.3954888582229614, 0.626952290534973...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Description: The following are all built-in JavaScript iterators: - The Array Iterator returned by `Array.prototype.values()`, `Array.prototype.keys()`, `Array.prototype.entries()`, `Array.prototype[Symbol.iterator]()`, `TypedArray.prototype.values()`, `TypedArray.prototype.ke...
[ -0.35057929158210754, -0.29468879103660583, -0.17715968191623688, 0.13858099281787872, 0.6389103531837463, -1.1373670101165771, 0.7991699576377869, 0.7064750790596008, -1.0980437994003296, 0.00949827115982771, 0.1438274085521698, 0.8496779799461365, -0.01584087684750557, 0.333954393863678,...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Description - Iterator helper methods: Note: These methods are iterator helpers, not iterable helpers, because the only requirement for an object to be iterable is just the presence of a `[Symbol.iterator]()` method. There is no shared prototype to install these methods on. Th...
[ 0.01905124820768833, 0.6314878463745117, -0.7138285636901855, 0.19512569904327393, 1.0907589197158813, -0.6403768658638, 0.39278101921081543, 1.2108725309371948, -0.47128257155418396, -0.03288669511675835, 0.020861323922872543, 1.01265287399292, -0.022675663232803345, 0.13181370496749878, ...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Description - Iterator helper objects: Note: Iterator helper objects and iterator helper methods are two different concepts. An Iterator helper object is detectable at runtime, while "iterator helper method" is just a name for a set of methods for comprehension. Iterator helper...
[ 0.45369744300842285, -0.44852662086486816, -1.472708821296692, 0.6249072551727295, 0.36201977729797363, -1.2929164171218872, -0.38010430335998535, 0.8200423121452332, -0.5713232755661011, 0.24643465876579285, -0.5480017066001892, -0.031636420637369156, -0.3388364017009735, 0.39370205998420...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Description - Proper iterators: There are two kinds of "iterators": objects that conform to the iterator protocol (which, at its minimum, only requires the presence of a `next()` method), and objects that inherit from the `Iterator` class, which enjoy the helper methods. They d...
[ -0.500031590461731, -0.4898383319377899, -1.108875036239624, 0.9330496191978455, 0.06614962220191956, -1.2530063390731812, -0.8317354321479797, 0.3572925329208374, -0.5501933097839355, 0.3193521201610565, -0.5094873905181885, 0.004520528018474579, -0.8021379709243774, -0.2032432109117508, ...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Constructor: - `Iterator()`: Intended to be extended by other classes that create iterators. Throws an error when constructed by itself.
[ -0.7384003400802612, -0.13347876071929932, -0.2881103456020355, 0.09528130292892456, 0.18012675642967224, -1.6494126319885254, -0.9031901955604553, 0.7855567336082458, -1.0970983505249023, -0.19542458653450012, -0.6081095933914185, -0.015207137912511826, -1.0406930446624756, 0.037153393030...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Static methods: - `Iterator.concat()`: Creates a new `Iterator` object from a list of iterable objects. The new iterator yields the values from each of the input iterables in sequence. - `Iterator.from()`: Creates a new `Iterator` object from an iterator or iterable object. - `...
[ -0.5158372521400452, -0.027894284576177597, -0.9015104174613953, 0.5952233672142029, 0.5626236796379089, -1.176312804222107, 0.21668599545955658, 0.526565432548523, -0.5347845554351807, 0.4804691970348358, -0.8058860301971436, -0.10152413696050644, -0.7671902775764465, 0.48320817947387695,...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Instance properties: These properties are defined on `Iterator.prototype` and shared by all `Iterator` instances. - `Iterator.prototype.constructor`: The constructor function that created the instance object. For `Iterator` instances, the initial value is the `Iterator` constr...
[ -0.0009462067973800004, -0.016340801492333412, 0.25222116708755493, 1.0164012908935547, 0.7521475553512573, -0.8244701027870178, 0.10583145916461945, 0.5895903706550598, -0.33722370862960815, -0.1114974319934845, -0.6026569604873657, 0.028276555240154266, -0.1980908215045929, 0.02002457529...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Instance methods: - `Iterator.prototype.drop()`: Returns a new iterator helper object that skips the given number of elements at the start of this iterator. - `Iterator.prototype.every()`: Returns `false` if it finds an element that does not satisfy the provided testing functio...
[ -0.23582202196121216, 0.5533133149147034, -0.13869166374206543, 0.4780505895614624, 0.4948803782463074, -0.8337200284004211, 0.5441789031028748, 1.0028424263000488, -0.6483211517333984, 0.25482141971588135, -1.0525354146957397, 0.19399133324623108, -0.3166954219341278, 0.3525538444519043, ...
javascript/reference/global_objects/iterator/index.md
JavaScript - Global Objects - Iterator - Examples - Using an iterator as an iterable: All built-in iterators are also iterable, so you can use them in a `for...of` loop: Example: const arrIterator = [1, 2, 3].values(); for (const value of arrIterator) { console.log(value); } // Logs: 1, 2, 3
[ -0.18630656599998474, 0.16017432510852814, -0.23795178532600403, 1.165964961051941, 0.04932031035423279, -1.353237509727478, -0.5617383122444153, 0.6456389427185059, -0.6012963056564331, 0.3559488356113434, 0.44095757603645325, 0.14921413362026215, -0.514868974685669, -0.03762902691960335,...
javascript/reference/global_objects/iterator/join/index.md
JavaScript - Global Objects - Iterator - join: The `join()` method of `Iterator` instances is similar to `Array.prototype.join()`: it returns a string that is the concatenation of all elements produced by the iterator, separated by commas or a specified separator string. If the iterator has only one item, that item's ...
[ -0.4288431406021118, -0.6036826968193054, -0.9459161758422852, 0.5906239748001099, -0.1457122564315796, -1.3998650312423706, 0.33344030380249023, 0.7465779185295105, -1.2009150981903076, 0.8199809193611145, -0.6380018591880798, -0.1997183859348297, -0.11848083138465881, 0.3149101436138153,...
javascript/reference/global_objects/iterator/join/index.md
JavaScript - Global Objects - Iterator - join - Syntax: Example: join() join(separator)
[ 0.19038383662700653, 0.24394869804382324, -1.1202205419540405, -0.32290390133857727, -0.7448630928993225, -1.6712605953216553, 0.6974021196365356, 0.5211926698684692, -0.8676624894142151, 0.30594539642333984, -0.5717191696166992, 0.05593866854906082, -0.2624256908893585, 0.4151299893856048...
javascript/reference/global_objects/iterator/join/index.md
JavaScript - Global Objects - Iterator - join - Syntax - Parameters: - `separator` (optional): A string to separate each pair of adjacent elements of the iterator. If omitted, the elements are separated with a comma (",").
[ -0.4689321219921112, -0.10677772015333176, -0.9191588163375854, 0.009120181202888489, 0.1600458025932312, -1.7942838668823242, 0.1791389435529709, 0.4225182831287384, -0.7188666462898254, 0.4620988368988037, -0.49189093708992004, 0.15586337447166443, -0.5509186387062073, 0.70632404088974, ...
javascript/reference/global_objects/iterator/join/index.md
JavaScript - Global Objects - Iterator - join - Syntax - Return value: A string joining all yielded elements. The elements are converted to strings. If an element is `undefined` or `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. If the iterator is empty, the empty string is ...
[ -0.5961891412734985, 0.2581326365470886, -0.5340606570243835, 0.24995779991149902, -0.3337472081184387, -1.6627789735794067, 1.1077549457550049, 0.8579311370849609, -0.6938859820365906, 0.7274318337440491, -0.561201274394989, 0.3789884150028229, -0.4332849085330963, 1.2148058414459229, -...
javascript/reference/global_objects/iterator/join/index.md
JavaScript - Global Objects - Iterator - join - Description: See `Array.prototype.join()` for details about how `join()` works. Unlike most other iterator helper methods, it does not work well with infinite iterators, because it is not lazy.
[ -0.5049533247947693, 0.08892243355512619, -1.0837666988372803, 0.09154428541660309, -0.6612221598625183, -0.8351007103919983, 0.37341299653053284, -0.10007753223180771, -1.0997934341430664, 0.6628153920173645, -0.6028075814247131, -0.12159126996994019, -0.0928259789943695, 0.18184997141361...
javascript/reference/global_objects/iterator/join/index.md
JavaScript - Global Objects - Iterator - join - Examples - Using join(): Example: function* fibonacci() { let current = 1; let next = 1; while (true) { yield current; [current, next] = [next, current + next]; } } console.log(fibonacci().take(5).join()); // "1,1,2,3,5" console.log(fibonacci().take(5)....
[ -0.6331756711006165, 0.026562444865703583, -1.2661806344985962, 0.551853597164154, -0.13743382692337036, -1.287445068359375, 0.6504342555999756, 0.6292455792427063, -0.6765815615653992, 0.18285664916038513, -0.8629611134529114, 0.11426061391830444, -0.24147692322731018, 0.409197598695755, ...
javascript/reference/global_objects/string/at/index.md
JavaScript - Global Objects - String - at: The `at()` method of `String` values takes an integer value and returns a new `String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character...
[ -1.2682759761810303, -0.8513182401657104, -1.222970962524414, -0.025785744190216064, 0.5517221093177795, -1.7680035829544067, -0.014309023506939411, 0.3643592894077301, -0.2211565375328064, -0.056420184671878815, -0.622881293296814, 0.33282744884490967, -0.08700056374073029, 0.001937951892...
javascript/reference/global_objects/string/at/index.md
JavaScript - Global Objects - String - at - Syntax: Example: at(index)
[ -0.2800971269607544, -0.15539897978305817, -1.0669305324554443, -0.011523619294166565, -0.9410908222198486, -1.8064548969268799, 0.0497448593378067, 0.3145364820957184, -0.42039427161216736, -0.16630832850933075, 0.050275154411792755, -0.04626328498125076, -0.34361401200294495, 0.021553121...
javascript/reference/global_objects/string/at/index.md
JavaScript - Global Objects - String - at - Syntax - Parameters: - `index`: The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e., if a negative number is used, the character returned will be found by counting back from the...
[ -1.37342369556427, -0.6320058107376099, -0.7504286766052246, -0.07623177766799927, -0.16366559267044067, -1.7435545921325684, 1.0417898893356323, 0.051453784108161926, -0.023235198110342026, -0.0678383857011795, -1.177366852760315, -0.004928451031446457, -0.05747988447546959, 1.02081620693...
javascript/reference/global_objects/string/at/index.md
JavaScript - Global Objects - String - at - Syntax - Return value: A `String` consisting of the single UTF-16 code unit located at the specified position. Returns `undefined` if the given index can not be found.
[ -1.163777470588684, -0.16348598897457123, -1.1715186834335327, -0.2961792051792145, -0.048120927065610886, -1.5969785451889038, 0.5255348086357117, 0.498030424118042, -0.026821229606866837, -0.21735048294067383, -0.2870326638221741, 0.6411067843437195, -0.09526978433132172, 0.2927367091178...
javascript/reference/global_objects/string/at/index.md
JavaScript - Global Objects - String - at - Examples - Return the last character of a string: The following example provides a function which returns the last character found in a specified string. Example: // A function which returns the last character of a given string function returnLast(str) { return str.at(-1...
[ -0.8815972208976746, 0.2428901493549347, -0.3027554750442505, -0.23381629586219788, -0.0176984965801239, -1.7910996675491333, 0.640326201915741, -0.16619771718978882, -0.3220343589782715, -0.08045139908790588, 0.725721001625061, 0.35689666867256165, -0.4047306776046753, 0.2945691645145416,...
javascript/reference/global_objects/string/at/index.md
JavaScript - Global Objects - String - at - Examples - Comparing methods: Here we compare different ways to select the penultimate (last but one) character of a `String`. While all below methods are valid, it highlights the succinctness and readability of the `at()` method. Example: const myString = "Every green bus...
[ -0.14703236520290375, -0.3421255946159363, 0.2698938250541687, 0.41211429238319397, 0.3261140286922455, -0.5912923812866211, 0.17847630381584167, 0.0670696273446083, 0.16720624268054962, 0.30144789814949036, -0.3351390063762665, -0.5012367963790894, 0.5712594389915466, -0.22349606454372406...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate: The `Temporal.PlainDate` object represents a calendar date (a date without a time or time zone); for example, an event on a calendar which happens during the whole day no matter which time zone it's happening in. It is fundamentally represented as an ISO 8601 calenda...
[ -1.528508186340332, 0.37250787019729614, -1.2707288265228271, 0.31202414631843567, -0.49209898710250854, -2.1085596084594727, -0.9780252575874329, 0.7048605680465698, -0.6972246766090393, 0.3954874575138092, -0.29468342661857605, 0.26142579317092896, 0.3040222227573395, 0.939182698726654, ...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Description: A `PlainDate` is essentially the date part of a `Temporal.PlainDateTime` object, with the time information removed. Because the date and time information don't have much interaction, all general information about date properties is documented here.
[ -2.0302562713623047, 0.11098825186491013, -1.077871322631836, -0.12421667575836182, -0.11197095364332199, -2.1279869079589844, -0.45052018761634827, 1.3652573823928833, -0.6707282662391663, 0.3644024729728699, -0.7667796015739441, 0.05794765055179596, 0.3036540746688843, 1.1329758167266846...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Description - RFC 9557 format: `PlainDate` objects can be serialized and parsed using the RFC 9557 format, an extension to the ISO 8601 / RFC 3339 format. The string has the following form (spaces are only for readability and should not be present in the actual stri...
[ -1.5335369110107422, 0.6584373712539673, -1.108588695526123, -0.2830570936203003, 0.17253798246383667, -0.7663650512695312, -0.634480893611908, 0.7112071514129639, -0.27756816148757935, 0.6315708160400391, -1.2672494649887085, 0.6399959921836853, -0.04352925345301628, 1.0153264999389648, ...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Description - Invalid date clamping: The `Temporal.PlainDate.from()`, `Temporal.PlainDate.prototype.with()`, `Temporal.PlainDate.prototype.add()`, `Temporal.PlainDate.prototype.subtract()` methods, and their counterparts in other `Temporal` objects, allow constructi...
[ -0.9036387801170349, -0.00468914769589901, -0.7641382217407227, 0.5611822605133057, 0.09902624785900116, -2.064101219177246, 0.08520125597715378, 0.9513638615608215, -1.4446884393692017, 0.682279646396637, -0.5440775752067566, 0.08955547213554382, -0.11764251440763474, 0.6941182613372803, ...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Constructor: - `Temporal.PlainDate()` (experimental): Creates a new `Temporal.PlainDate` object by directly supplying the underlying data.
[ -2.228255271911621, 0.16653136909008026, -0.5568357110023499, 0.14425970613956451, -0.29412513971328735, -1.71632719039917, -0.3598337769508362, 0.7696294784545898, -1.0095399618148804, 0.6186398863792419, -0.7663690447807312, 0.23628270626068115, 0.08633154630661011, 0.7833301424980164, ...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Static methods: - `Temporal.PlainDate.compare()`: Returns a number (-1, 0, or 1) indicating whether the first date comes before, is the same as, or comes after the second date. Equivalent to comparing the year, month, and day fields of the underlying ISO 8601 dates....
[ -1.9948335886001587, 0.14797139167785645, -0.7169457077980042, 0.04371289908885956, 0.09646375477313995, -2.17148756980896, -0.2736779451370239, 0.931511640548706, -0.9690296053886414, 0.9695234894752502, -1.0725096464157104, 0.1344224512577057, -0.11383972316980362, 0.6692904829978943, ...
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Instance properties: These properties are defined on `Temporal.PlainDate.prototype` and shared by all `Temporal.PlainDate` instances. - `Temporal.PlainDate.prototype.calendarId`: Returns a string representing the calendar used to interpret the internal ISO 8601 dat...
[ 0.5679270029067993, 0.6544860601425171, -0.6235628724098206, 0.4140276610851288, 0.8537608981132507, -1.509835124015808, 0.1507139801979065, 1.739791750907898, -0.9175083637237549, 0.3941555917263031, -0.26874440908432007, 0.8788771629333496, -0.13768988847732544, 0.4785395860671997, -1....
javascript/reference/global_objects/temporal/plaindate/index.md
JavaScript - Global Objects - Temporal - PlainDate - Instance methods: - `Temporal.PlainDate.prototype.add()`: Returns a new `Temporal.PlainDate` object representing this date moved forward by a given duration (in a form convertible by `Temporal.Duration.from()`). - `Temporal.PlainDate.prototype.equals()`: Returns `tr...
[ 0.3022635579109192, 0.036656927317380905, -0.35918503999710083, 0.7190101146697998, 0.43896275758743286, -1.2164301872253418, 0.6177260875701904, 1.2983182668685913, -0.9770566821098328, 0.2540351450443268, -0.8468604683876038, 1.0713378190994263, 0.07823016494512558, 0.7159891724586487, ...
javascript/reference/global_objects/temporal/zoneddatetime/offsetnanoseconds/index.md
JavaScript - Global Objects - Temporal - ZonedDateTime - offsetNanoseconds: The `offsetNanoseconds` accessor property of `Temporal.ZonedDateTime` instances returns an integer representing the offset used to interpret the internal instant, as a number of nanoseconds (positive or negative). The value is a safe integer b...
[ -0.8395642042160034, -0.24207866191864014, -0.9384035468101501, 0.6842553615570068, -0.17083986103534698, -1.2037409543991089, 0.3351534307003021, 0.24747738242149353, -0.20558258891105652, 0.4101096987724304, -1.2707433700561523, -0.03154374659061432, -0.49834373593330383, -0.598561167716...
javascript/reference/global_objects/temporal/zoneddatetime/offsetnanoseconds/index.md
JavaScript - Global Objects - Temporal - ZonedDateTime - offsetNanoseconds - Examples - Using offsetNanoseconds: Example: const dt = Temporal.ZonedDateTime.from( "2021-07-01T12:00:00-07:00[America/Los_Angeles]", ); console.log(dt.offsetNanoseconds); // -25200000000000 const dt2 = Temporal.ZonedDateTime.from( "20...
[ -1.197606086730957, 0.10814426839351654, -0.5281023979187012, 1.059464931488037, -0.15625140070915222, 0.1984935700893402, -0.4804016947746277, 0.3203660249710083, -0.3061401844024658, 0.32012951374053955, -0.2434328943490982, 0.04545384645462036, -0.6254975199699402, 0.29826173186302185, ...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray: A TypedArray object describes an array-like view of an underlying binary data buffer. There is no global property named `TypedArray`, nor is there a directly visible `TypedArray` constructor. Instead, there are a number of different global properties, whose values are typed ar...
[ -0.3252038359642029, -0.45463305711746216, -1.2174829244613647, 0.3099277913570404, -0.41187140345573425, -1.148067593574524, -0.359065443277359, 0.9674390554428101, 0.5085473656654358, 0.15362480282783508, -0.22140727937221527, -0.08314507454633713, -0.142742320895195, 0.1735312044620514,...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Description: The `TypedArray` constructor (often referred to as `%TypedArray%` to indicate its "intrinsicness", since it does not correspond to any global exposed to a JavaScript program) serves as the common superclass of all `TypedArray` subclasses. Think about `%TypedArray...
[ -0.10258044302463531, -0.07737882435321808, -0.49997642636299133, 0.879396378993988, 0.7459165453910828, -0.2954065501689911, -0.40966638922691345, 1.5039838552474976, 0.015432476997375488, -0.1312694549560547, -0.41043850779533386, 0.2122618556022644, 0.09838464856147766, 0.29647651314735...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Description - TypedArray objects: - Type: `Int8Array`, Value Range: -128 to 127, Size in bytes: 1, Web IDL type: `byte` - Type: `Uint8Array`, Value Range: 0 to 255, Size in bytes: 1, Web IDL type: `octet` - Type: `Uint8ClampedArray`, Value Range: 0 to 255, Size in bytes: 1, W...
[ -0.7821362614631653, -0.33509793877601624, -1.1748528480529785, -0.626544177532196, -0.023167923092842102, 0.0244784913957119, -0.6290280222892761, 0.24977734684944153, -0.1608828902244568, -0.024580344557762146, -0.16019271314144135, 0.7770741581916809, -0.40554872155189514, -0.2931870222...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Description - Value encoding and normalization: All typed arrays operate on `ArrayBuffer`s, where you can observe the exact byte representation of each element, so how the numbers are encoded in binary format is significant. - Unsigned integer arrays (`Uint8Array`, `Uint16Ar...
[ 0.2362503707408905, -0.6236109137535095, -0.8193672299385071, 0.6605063080787659, 0.6609312891960144, -0.0884803757071495, -0.15349461138248444, 1.0213580131530762, 0.25988397002220154, -0.14783355593681335, -0.3803007900714874, 0.5100134611129761, -0.38648471236228943, 0.48374873399734497...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Description - Behavior when viewing a resizable buffer: When a `TypedArray` is created as a view of a resizable buffer, resizing the underlying buffer will have different effects on the size of the `TypedArray` depending on whether the `TypedArray` is constructed as length-tr...
[ -0.35701870918273926, -0.004586006514728069, -0.49586114287376404, 0.3526573181152344, 0.8092906475067139, -0.4476943910121918, -0.05735365301370621, 0.8136089444160461, 0.35669317841529846, 0.10588334500789642, -0.050003089010715485, -0.009341254830360413, -0.8811406493186951, 0.122576564...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Constructor: This object cannot be instantiated directly — attempting to construct it with `new` throws a `TypeError`. Example: new (Object.getPrototypeOf(Int8Array))(); // TypeError: Abstract class TypedArray not directly constructable Instead, you create an instance of a...
[ 0.14948363602161407, 0.055251963436603546, 0.3963265120983124, 0.4551568627357483, 0.9735720157623291, -1.2917782068252563, -0.3210507035255432, 1.1277682781219482, -0.2525351643562317, 0.5096936821937561, -0.5916091799736023, 0.08146420121192932, 0.37961429357528687, -0.022200051695108414...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Constructor - Parameters: - `typedArray`: When called with an instance of a `TypedArray` subclass, the `typedArray` gets copied into a new typed array. For a non-bigint `TypedArray` constructor, the `typedArray` parameter can only be of one of the non-bigint types (such as `I...
[ -0.6487441658973694, 0.04584628343582153, -0.7242140769958496, 0.5455640554428101, 0.6672391891479492, -0.4966970980167389, 0.28784796595573425, 0.7528519630432129, -0.13237795233726501, 0.5582916736602783, -0.9183523058891296, 0.367779940366745, -0.02380891516804695, 0.3667149841785431, ...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Constructor - Exceptions: All `TypeArray` subclass constructors operate in the same way. They would all throw the following exceptions: - `TypeError`: Thrown in one of the following cases: - A `typedArray` is passed but it is a bigint type while the current constructor is ...
[ -0.30165210366249084, -0.8521945476531982, -1.1392065286636353, 0.5614754557609558, 0.21010619401931763, -0.2903142273426056, -0.957922637462616, 0.9925609827041626, -0.2160702347755432, 0.1286516785621643, -0.21314968168735504, -0.263734370470047, -0.3168971836566925, 0.5112115144729614, ...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Static properties: These properties are defined on the `TypedArray` constructor object and are thus shared by all `TypedArray` subclass constructors. - `TypedArray[Symbol.species]`: The constructor function used to create derived objects. All `TypedArray` subclasses also ha...
[ -0.19971363246440887, -0.5424050688743591, -1.090768814086914, 0.11811627447605133, 0.4466743469238281, -1.321524977684021, 0.21370342373847961, 0.7758346199989319, 0.13937270641326904, 0.5469673871994019, -0.6327263116836548, 0.40091419219970703, -0.8507769703865051, 0.13919226825237274, ...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Static methods: These methods are defined on the `TypedArray` constructor object and are thus shared by all `TypedArray` subclass constructors. - `TypedArray.from()`: Creates a new `TypedArray` from an array-like or iterable object. See also `Array.from()`. - `TypedArray.of(...
[ -0.3019872009754181, -0.7700116038322449, -0.5691712498664856, 0.9498955607414246, 0.7338157892227173, -0.7931402921676636, 0.1946261078119278, 0.9343081116676331, -0.023217134177684784, 0.502949595451355, -0.4722435176372528, 0.006879329681396484, 0.6507421731948853, 0.14159509539604187, ...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Instance properties: These properties are defined on `TypedArray.prototype` and shared by all `TypedArray` subclass instances. - `TypedArray.prototype.buffer`: Returns the `ArrayBuffer` referenced by the typed array. - `TypedArray.prototype.byteLength`: Returns the length (i...
[ -0.1282203197479248, 0.0736706554889679, -0.39052239060401917, 0.6279615759849548, 0.4372805953025818, -0.9115681648254395, 0.42347151041030884, 0.7779995203018188, 0.2254173755645752, 0.03293211758136749, -1.0134233236312866, 0.2647022604942322, 0.04643818736076355, -0.07123453170061111, ...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Instance methods: These methods are defined on the `TypedArray` prototype object and are thus shared by all `TypedArray` subclass instances. - `TypedArray.prototype.at()`: Takes an integer value and returns the item at that index. This method allows for negative integers, wh...
[ 0.5586352944374084, -0.055895764380693436, -0.4726136326789856, 0.5791968107223511, 0.7511687874794006, -0.9636237025260925, 0.9255368709564209, 1.4878435134887695, -0.4426482319831848, 0.32715192437171936, -0.27085691690444946, 0.916218101978302, -0.028172064572572708, 0.7655960321426392,...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Examples - Property access: You can reference elements in the array using standard array index syntax (that is, using bracket notation). However, getting or setting indexed properties on typed arrays will not search in the prototype chain for this property, even when the indi...
[ -0.08145948499441147, 0.02396753430366516, -0.8167739510536194, 0.9979166984558105, -0.04777850583195686, -1.223055124282837, 0.8212889432907104, 0.3698256015777588, -0.009968675673007965, -0.21421454846858978, -0.9062575101852417, 0.592125415802002, -0.03223474696278572, -0.56640177965164...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Examples - Cannot be frozen: `TypedArray`s that aren't empty cannot be frozen, as their underlying `ArrayBuffer` could be mutated through another `TypedArray` view of the buffer. This would mean that the object would never genuinely be frozen. Example: const i8 = Int8Array....
[ 0.28527018427848816, 0.08924119919538498, -0.8836953639984131, -0.13845708966255188, -0.20291383564472198, -1.5382009744644165, -0.34024137258529663, 1.0022919178009033, -0.03697890788316727, -0.44410791993141174, 0.1814354509115219, -0.8068187236785889, 0.07133492082357407, -0.10918305814...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Examples - ByteOffset must be aligned: When constructing a `TypedArray` as a view onto an `ArrayBuffer`, the `byteOffset` argument must be aligned to its element size; in other words, the offset must be a multiple of `BYTES_PER_ELEMENT`. Example: const i32 = new Int32Array(...
[ 0.3161064386367798, -0.10798235237598419, -1.2037999629974365, 0.6770344376564026, 0.6368903517723083, -0.3617312014102936, -0.38841164112091064, 0.5317115187644958, -0.2737928032875061, 0.4667774736881256, -0.18335647881031036, -0.0058090537786483765, -0.361431747674942, 0.052196942269802...
javascript/reference/global_objects/typedarray/index.md
JavaScript - Global Objects - TypedArray - Examples - ByteLength must be aligned: Like the `byteOffset` parameter, the `byteLength` property of an `ArrayBuffer` passed to a `TypedArray`'s constructor must be a multiple of the constructor's `BYTES_PER_ELEMENT`. Example: const i32 = new Int32Array(new ArrayBuffer(3));...
[ 0.0898679792881012, -0.2932247817516327, -1.2561063766479492, 0.7077195048332214, 0.39885762333869934, -0.7440269589424133, -0.9897087216377258, 0.26615649461746216, -0.39601555466651917, 0.28187885880470276, -0.08031044900417328, 0.33447641134262085, -0.3459904193878174, -0.02000932022929...
javascript/reference/global_objects/typedarray/join/index.md
JavaScript - Global Objects - TypedArray - join: The `join()` method of `TypedArray` instances returns a new string that is the concatenation of all elements in this typed array, separated by commas or a specified separator string. If the typed array has only one item, that item's stringification is returned without u...
[ 0.03979086875915527, -1.0534327030181885, -1.5058398246765137, 0.285237193107605, -0.09932556748390198, -0.9853501915931702, 0.09594029188156128, 0.8323017358779907, -0.5278362035751343, 0.8470492959022522, -0.2130936086177826, 0.1635044813156128, 0.3169674277305603, -0.04305198788642883, ...
javascript/reference/global_objects/typedarray/join/index.md
JavaScript - Global Objects - TypedArray - join - Syntax: Example: join() join(separator)
[ 0.8608500361442566, -0.1144241914153099, -1.5214251279830933, -0.4970281422138214, -0.7259966731071472, -1.3577558994293213, 0.6049253344535828, 0.6485778093338013, -0.5792095065116882, 0.4592239260673523, -0.5783542990684509, -0.08774632960557938, 0.027165323495864868, 0.129539355635643, ...
javascript/reference/global_objects/typedarray/join/index.md
JavaScript - Global Objects - TypedArray - join - Syntax - Parameters: - `separator` (optional): A string to separate each pair of adjacent elements of the typed array. If omitted, the typed array elements are separated with a comma (",").
[ 0.005427418276667595, -0.3464159667491913, -1.1767480373382568, 0.3623135983943939, 0.3499148190021515, -1.379799485206604, -0.05547976866364479, 0.645275890827179, -0.4039631187915802, 0.6379421949386597, -0.5137921571731567, 0.09307213127613068, -0.7120369076728821, 0.4232919216156006, ...
javascript/reference/global_objects/typedarray/join/index.md
JavaScript - Global Objects - TypedArray - join - Syntax - Return value: A string with all typed array elements joined. If `array.length` is `0`, the empty string is returned.
[ -0.16503268480300903, -0.1309465765953064, -0.869137704372406, 0.026702269911766052, -0.39972788095474243, -1.167318344116211, 1.0906596183776855, 0.7580291628837585, -0.7384343147277832, 0.5008561611175537, -0.5964762568473816, 0.3936749994754791, -0.26454776525497437, 0.5863772630691528,...
javascript/reference/global_objects/typedarray/join/index.md
JavaScript - Global Objects - TypedArray - join - Description: See `Array.prototype.join()` for more details. This method is not generic and can only be called on typed array instances.
[ 0.06431149691343307, 0.15375570952892303, -0.6350324153900146, 0.3227421045303345, -0.43577080965042114, -0.4838995635509491, 0.41804587841033936, 0.4378766417503357, -0.43815597891807556, 0.3460012376308441, -0.5624372959136963, -0.26997894048690796, 0.36614787578582764, -0.09340912103652...
javascript/reference/global_objects/typedarray/join/index.md
JavaScript - Global Objects - TypedArray - join - Examples - Using join(): Example: const uint8 = new Uint8Array([1, 2, 3]); uint8.join(); // '1,2,3' uint8.join(" / "); // '1 / 2 / 3' uint8.join(""); // '123'
[ 0.11800020933151245, -0.3810012638568878, -1.4891048669815063, 0.3154684007167816, -0.4409114122390747, -0.7270820140838623, -0.40277981758117676, 0.48826122283935547, -0.736309826374054, 0.6284336447715759, -0.5555791854858398, -0.04511162266135216, 0.3838476538658142, -0.0249415673315525...
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.009049954824149609, -1.0818835496902466, -1.170217752456665, 0.18278342485427856, 0.30864277482032776, -0.7170677185058594, -0.5402188301086426, 0.4189911186695099, -0.7698870301246643, 0.7543607950210571, 0.1511840671300888, 0.5799883604049683, -0.37822309136390686, 0.21438464522361755,...
javascript/reference/global_objects/typedarray/at/index.md
JavaScript - Global Objects - TypedArray - at - Syntax: Example: at(index)
[ 0.5984078645706177, -0.3005625903606415, -1.1696382761001587, -0.08420398831367493, -0.7442978024482727, -1.2461806535720825, -0.20185811817646027, 0.5294653177261353, -0.5085474252700806, 0.055842068046331406, 0.21623565256595612, -0.20765548944473267, -0.3102376461029053, 0.0380802825093...
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.021675726398825645, -0.29309654235839844, -0.8736163377761841, 0.6920865178108215, 0.07551008462905884, -0.7881039977073669, 0.4151659905910492, 1.0757948160171509, -0.3827604651451111, 0.013240785337984562, -0.8010240793228149, 0.4563571810722351, -0.03925027698278427, 0.34799855947494...
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.573641836643219, -0.40593886375427246, -1.0297476053237915, 0.1844804286956787, -0.6031327247619629, -0.7563973069190979, 0.7148779630661011, 0.4634978771209717, -0.6497106552124023, -0.051875241100788116, -0.18990954756736755, 0.5793260931968689, -0.34820911288261414, 0.779258012771606...
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.13878686726093292, -0.13635003566741943, -0.5337486267089844, -0.032362811267375946, -0.3478979170322418, -0.8061397075653076, -0.024720478802919388, 0.611311674118042, -0.5727137923240662, 0.11223078519105911, -0.01525779627263546, 0.11192724108695984, 0.34041133522987366, -0.078751288...
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.055803392082452774, -0.4397023916244507, -1.3818552494049072, -0.037899818271398544, -0.5467894077301025, -0.9021299481391907, -0.14015112817287445, 0.5818737745285034, -0.7885761260986328, 0.2764536142349243, 0.725980281829834, 0.629901111125946, 0.009171586483716965, 0.3840374648571014...
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`. While all below methods are valid, it highlights the succinctness and readability of the `at()` method. Example: // Our typed array with values...
[ 0.040573008358478546, -0.5227306485176086, -0.8666735291481018, 0.46103566884994507, -0.2842417359352112, -0.8419582843780518, -0.20633341372013092, 0.06642351299524307, -0.49093520641326904, 1.167993187904358, 0.8059634566307068, -0.10051754862070084, -0.013922829180955887, -0.10935129225...
javascript/reference/global_objects/number/index.md
JavaScript - Global Objects - Number: `Number` values represent floating-point numbers like `37` or `-9.25`. The `Number` constructor contains constants and methods for working with numbers. Values of other types can be converted to numbers using the `Number()` function.
[ -0.6885557174682617, -0.20093713700771332, -1.0915316343307495, -0.38836678862571716, -0.3940390646457672, -1.9083027839660645, 0.00888126716017723, 0.8021067380905151, -0.0581221878528595, -0.15010327100753784, -0.9058316349983215, 0.3782106339931488, 0.030106492340564728, 0.0018568672239...
javascript/reference/global_objects/number/index.md
JavaScript - Global Objects - Number - Description: Numbers are most commonly expressed in literal forms like `255` or `3.14159`. The lexical grammar contains a more detailed reference. Example: 255; // two-hundred and fifty-five 255.0; // same number 255 === 255.0; // true 255 === 0xff; // true (hexadecimal notatio...
[ -1.487980604171753, -0.2732301354408264, -0.6445812582969666, -0.3020101487636566, -0.03482047840952873, -0.8742977976799011, 0.6455045938491821, 0.5531787872314453, -0.44748663902282715, 0.0840713381767273, -0.8161776661872864, 0.47978514432907104, -0.8719543218612671, -0.2745918035507202...
javascript/reference/global_objects/number/index.md
JavaScript - Global Objects - Number - Description - Number encoding: The JavaScript `Number` type is a double-precision 64-bit binary format IEEE 754 value, like `double` in Java or C#. This means it can represent fractional values, but there are some limits to the stored number's magnitude and precision. Very briefl...
[ -0.6538453698158264, -0.640403151512146, -0.774031400680542, 0.6255308985710144, -0.22878897190093994, -1.7224808931350708, 0.32750484347343445, 0.8432435393333435, 0.10283073782920837, 0.6623622179031372, -0.9191083312034607, 1.4753323793411255, -0.8790877461433411, 0.6708199977874756, ...