file
stringlengths
16
94
text
stringlengths
32
24.4k
vector
list
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - L: - `lang` - `lengthAdjust` - `letter-spacing` - `lighting-color` - `limitingConeAngle`
[ -0.9480195641517639, -0.13974006474018097, 0.18226177990436554, -0.3771366775035858, -0.577329158782959, -1.0036041736602783, 0.56755131483078, 0.47758233547210693, -0.47348299622535706, -0.7411422729492188, 0.05619530379772186, -0.1842099130153656, -0.5014263987541199, 0.14000862836837769...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - M: - `marker-end` - `marker-mid` - `marker-start` - `markerHeight` - `markerUnits` - `markerWidth` - `mask` - `maskContentUnits` - `maskUnits` - `max` - `media` - `method` - `min` - `mode`
[ -0.2970810532569885, -0.5665445923805237, -0.5041427612304688, -0.42662572860717773, -0.3689894378185272, -0.8020262718200684, 0.7076294422149658, 0.6631376147270203, -0.0987173467874527, -0.46952125430107117, -0.19984589517116547, 0.25390106439590454, -0.3179837763309479, 0.03059241175651...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - N: - `numOctaves`
[ -0.16754291951656342, -0.15084707736968994, -0.4108632504940033, -0.5812163352966309, -1.0940101146697998, -0.8273192644119263, 1.7905477285385132, 0.7291698455810547, -0.7282748222351074, -0.41042083501815796, 0.20570549368858337, -0.48148655891418457, -0.5920374393463135, 0.0045611038804...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - O: - `offset` - `opacity` - `operator` - `order` - `orient` - `origin` - `overflow`
[ -0.6236295700073242, -0.8676262497901917, -0.8619972467422485, -0.47980257868766785, -0.41696640849113464, -0.9081429243087769, 1.01633620262146, 0.6278957724571228, 0.5346066951751709, -0.7463202476501465, -0.19089648127555847, -0.4566991925239563, 0.3231297731399536, 0.16962754726409912,...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - P: - `paint-order` - `path` - `pathLength` - `patternContentUnits` - `patternTransform` - `patternUnits` - `ping` - `pointer-events` - `points` - `pointsAtX` - `pointsAtY` - `pointsAtZ` - `preserveAlpha` - `preserveAspectRatio` - `primitiveUnits`
[ -0.7859756350517273, -0.395305335521698, -0.4253937602043152, 0.40278390049934387, -0.9776238203048706, -1.4423941373825073, 1.176102638244629, 0.26171061396598816, -0.25069308280944824, 0.07151533663272858, -0.3863871395587921, 0.09409832954406738, -0.21250855922698975, 0.2815299928188324...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - R: - `r` - `radius` - `referrerPolicy` - `refX` - `refY` - `rel` - `repeatCount` - `repeatDur` - `requiredExtensions` - `requiredFeatures` - `restart` - `result` - `rotate` - `rx` - `ry`
[ -1.1968921422958374, 0.1525225192308426, 0.08217992633581161, 0.3208196461200714, -0.9817967414855957, -0.45172208547592163, 1.649446964263916, 0.36477845907211304, -0.23496834933757782, -0.24387142062187195, -0.16599681973457336, -0.10357924550771713, -0.8344468474388123, 0.60587507486343...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - S: - `scale` - `seed` - `shape-rendering` - `side` - `slope` - `spacing` - `specularConstant` - `specularExponent` - `spreadMethod` - `startOffset` - `stdDeviation` - `stitchTiles` - `stop-color` - `stop-opacity` - `stroke` - `stroke-dasharray` - `stroke-dashoffset` - `stroke-...
[ -1.3278441429138184, -0.8088284730911255, -0.25086891651153564, -0.5851871967315674, -0.13586612045764923, -0.785680890083313, 0.9885091781616211, 0.9161316156387329, 0.7574031352996826, -0.27227139472961426, -0.041773658245801926, 0.4991198778152466, -0.5013624429702759, 0.101221889257431...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - T: - `tabindex` - `tableValues` - `target` - `targetX` - `targetY` - `text-anchor` - `text-decoration` - `text-overflow` - `text-rendering` - `textLength` - `to` - `transform` - `transform-origin` - `type`
[ -0.742114782333374, -0.2647845149040222, -0.29370996356010437, 0.2642763555049896, -0.43321487307548523, -0.7915096879005432, 0.7415022253990173, 0.4952581524848938, -0.08040189743041992, -0.4124935567378998, 0.3780404329299927, -0.36128076910972595, -0.6339026093482971, 0.2375606000423431...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - U: - `unicode-bidi`
[ -1.358446478843689, -0.22524181008338928, -0.85442715883255, 0.22398430109024048, -0.4877597391605377, -0.9467822909355164, 1.1074730157852173, 0.36475464701652527, 0.20935067534446716, -0.5070905685424805, -0.2403627187013626, -0.41352131962776184, 0.22630378603935242, 0.33537790179252625...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - V: - `values` - `vector-effect` - `version` - `viewBox` - `visibility`
[ -0.5564229488372803, -0.3382498025894165, -0.15359054505825043, -0.10702067613601685, -0.5081933736801147, -0.6052172183990479, 1.0139472484588623, 1.1242347955703735, 0.23340529203414917, -0.6136088967323303, 0.22982317209243774, -0.1475275307893753, 0.08143298327922821, 0.306019335985183...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - W: - `white-space` - `width` - `word-spacing` - `writing-mode`
[ -0.893988847732544, -0.2183760702610016, 0.11350613832473755, -0.36216068267822266, -0.31325578689575195, -0.12458506226539612, 0.9344744682312012, 0.8400236368179321, 0.6300248503684998, -0.4540634751319885, 0.026396416127681732, 0.14415466785430908, -0.25752151012420654, -0.1673359870910...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - X: - `x` - `x1` - `x2` - `xChannelSelector` - `xlink:actuate` - `xlink:arcrole` - `xlink:href` (deprecated) - `xlink:role` - `xlink:show` - `xlink:title` - `xlink:type` - `xml:lang` - `xml:space`
[ -1.163698434829712, -0.6153282523155212, -0.33568301796913147, 0.2380795180797577, -0.45574522018432617, -0.25259220600128174, 1.4563754796981812, 0.5212880969047546, -0.10980208218097687, -0.6720163822174072, 0.38827162981033325, -0.6767244338989258, -0.4939076006412506, -0.18455342948436...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - Y: - `y` - `y1` - `y2` - `yChannelSelector`
[ -0.801645040512085, -0.28485915064811707, -0.07076338678598404, 0.02844204753637314, 0.031310319900512695, -0.36406803131103516, 0.25752148032188416, 0.8295385837554932, -0.08175652474164963, -0.4253973066806793, 0.22207900881767273, -0.015361648052930832, -0.17442715167999268, 0.070755392...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes A to Z - Z: - `z` - `zoomAndPan`
[ -1.1058653593063354, 0.314992755651474, -0.23038950562477112, -0.22303162515163422, -1.0103914737701416, -0.6627584099769592, 1.3535220623016357, 0.27034521102905273, -0.640365719795227, -0.5849474668502808, -0.09212537109851837, 0.09474454820156097, -0.6437314748764038, 0.0837065577507019...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Core attributes: The core attributes are global attributes. - `autofocus` - `id` - `class` - `style` - `lang` - `tabindex` - `xml:lang` - `xml:space`
[ -1.980008602142334, 0.21829774975776672, -0.6145688891410828, 0.16386006772518158, -0.46325168013572693, -1.4148459434509277, 0.5469151735305786, 0.21468967199325562, 0.031869322061538696, -0.3969773054122925, -0.2963316738605499, -0.3233245611190796, -0.4580400884151459, 0.948335886001586...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Conditional processing attributes: The conditional processing attributes control whether the elements they are set on are processed. - `requiredExtensions` - `requiredFeatures` - `systemLanguage`
[ -1.927612066268921, -0.5296141505241394, -0.69016033411026, 0.4176683723926544, -0.5593270063400269, -1.4206558465957642, 0.6135430335998535, 1.616188883781433, -0.18185603618621826, -0.0047931186854839325, -0.9707754254341125, -1.278267502784729, 0.21196669340133667, 0.8307051658630371, ...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - XLink attributes: The XLink attributes can reference resources. - `xlink:href` (deprecated) - `xlink:type` (deprecated) - `xlink:role` (deprecated) - `xlink:arcrole` (deprecated) - `xlink:title` (deprecated) - `xlink:show` (deprecated) - `xlink:actuate` (deprecated)
[ -1.516317367553711, -0.11999909579753876, -0.25445640087127686, 0.7783024311065674, -0.42599430680274963, -1.1866475343704224, 2.159451484680176, 0.540919303894043, 0.4805756211280823, -0.4514364004135132, -0.20034143328666687, -0.5636309385299683, -0.5023079514503479, 0.24726182222366333,...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Presentation attributes: SVG presentation attributes are SVG attributes that can also be used as CSS properties on SVG elements. They set CSS property values on an element with a specificity of `0`, so other author styles in a stylesheet or `style` attribute can override ...
[ 0.34733399748802185, -0.05637082830071449, -0.08046996593475342, 0.16108499467372894, 0.06818202137947083, -1.8246616125106812, 0.3453195095062256, 1.411971092224121, 0.014269329607486725, 0.19600185751914978, -0.23340478539466858, 0.41494694352149963, 0.7546979784965515, 0.093243673443794...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Presentation attributes - Geometry properties: Geometry properties describe the position and dimensions of SVG shapes. In SVG 2, they are a defined subset of presentation attributes whose CSS counterparts do not inherit. Each geometry property applies as a presentation a...
[ -1.8654896020889282, -0.015328400768339634, -0.1773834079504013, 0.08138883113861084, -0.19553963840007782, -0.9581612944602966, 0.8287996053695679, 0.7119544744491577, 0.8188804388046265, -0.3861810863018036, 0.41596996784210205, 0.37008902430534363, -0.01115996204316616, 0.39895838499069...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Filters attributes: - Filter primitive attributes (presentation attributes): `height`, `result`, `width`, `x`, `y` - Transfer function attributes: `type`, `tableValues`, `slope`, `intercept`, `amplitude`, `exponent`, `offset`
[ -1.7081416845321655, -0.7434122562408447, -0.7632301449775696, 0.5392870306968689, 0.0029499903321266174, -0.4509715437889099, 0.8750175833702087, 0.46114444732666016, 0.2941513955593109, -0.15709073841571808, -0.22336280345916748, -0.5207335948944092, -0.6208459138870239, 1.10075020790100...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Animation attributes: - Animation target element attributes: `href` - Animation attribute target attributes: `attributeType`, `attributeName` - Animation timing attributes: `begin`, `dur`, `end`, `min`, `max`, `restart`, `repeatCount`, `repeatDur`, `fill` - Animation valu...
[ -0.751030445098877, -0.6837542057037354, -0.2855459749698639, 0.6712237000465393, -0.4409259855747223, -0.7396647334098816, 0.8834348917007446, 0.5226519107818604, -0.2366953045129776, -0.6335437893867493, 0.047714442014694214, -0.8653066754341125, -0.9112874865531921, 0.46810513734817505,...
svg/reference/attribute/index.md
SVG - Attribute - SVG attributes by category - Event attributes: All HTML and SVG elements support event handler attributes defined on the `GlobalEventHandlers` mixin. While event handler attributes, like `onblur` and `onauxclick`, apply to all elements, they may not have any effect. For example, the `oncuechange` at...
[ -0.829220712184906, 0.07972888648509979, -0.45968905091285706, 0.6722443103790283, -0.0896371603012085, -2.0983099937438965, 0.3710647225379944, -0.0726812332868576, 0.10146073997020721, -0.3249448835849762, 0.18371106684207916, 0.0632474422454834, -0.10782399028539658, -0.3587384223937988...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength: The `pathLength` attribute lets authors specify a total length for the path, in user units. This value is then used to calibrate the browser's distance calculations with those of the author, by scaling all distance computations using the ratio `pathLength` / (computed value of path length...
[ 0.0025470813270658255, -0.350002646446228, -0.6855879426002502, 0.34121251106262207, 0.3158029615879059, -1.1622045040130615, 0.5183836221694946, 0.5446732640266418, 0.6061615943908691, 0.22833605110645294, 0.032007113099098206, 0.5638957619667053, 0.49611425399780273, -0.39243853092193604...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - Example: Example: html, body, svg { height: 100%; } Example: <svg viewBox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <style> path { fill: none; stroke: black; stroke-width: 2; stroke-dasharray: 10; } </style> <!-- No pathLength, the real ...
[ -0.9648032784461975, -1.0537806749343872, -0.808650016784668, 0.21282154321670532, -0.28883033990859985, -1.2476933002471924, 1.3044317960739136, -0.08068026602268219, 0.3318856954574585, 0.017314959317445755, 0.5627394914627075, 0.1937485635280609, 0.8314672708511353, -0.7326729893684387,...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - circle: For `circle`, `pathLength` lets authors specify a total length for the circle, in user units.
[ -1.4397776126861572, -0.482403427362442, -1.1437547206878662, 0.7319594025611877, -0.021495051681995392, -1.2645289897918701, 0.48755401372909546, -0.34112823009490967, 0.259901225566864, -0.4261460304260254, -0.45877987146377563, -0.3118586838245392, 0.3743409812450409, -0.599278688430786...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - ellipse: For `ellipse`, `pathLength` lets authors specify a total length for the ellipse, in user units.
[ -0.9487777948379517, -0.5010942220687866, -1.1205552816390991, 0.7655718922615051, -0.2927148938179016, -1.95852530002594, 0.6762977242469788, -0.3323162794113159, 0.12051469087600708, -0.4398594796657562, -0.32235094904899597, 0.04262380301952362, 0.4853084087371826, -0.3392917513847351, ...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - line: For `line`, `pathLength` lets authors specify a total length for the line, in user units.
[ -0.8879230618476868, -1.2405266761779785, -1.3785910606384277, 0.583232045173645, -0.1330539584159851, -1.3798667192459106, 0.5500109791755676, -0.13666437566280365, 0.31248584389686584, -0.6587944626808167, -0.7972214221954346, -0.14110958576202393, 0.49191635847091675, -0.620461285114288...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - path: For `path`, `pathLength` lets authors specify a total length for the path, in user units.
[ -0.7188100814819336, -1.1316524744033813, -1.0831271409988403, 0.9809250831604004, -0.19860422611236572, -1.4717506170272827, 0.9275543689727783, -0.3128723204135895, 0.057712629437446594, -0.5935901999473572, -0.5584955215454102, -0.15657728910446167, 0.37973159551620483, -0.8302165269851...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - polygon: For `polygon`, `pathLength` lets authors specify a total length for the shape, in user units.
[ -0.617092490196228, -1.183279037475586, -1.1089941263198853, 0.02384468913078308, -0.025385789573192596, -1.4316763877868652, 0.9219866394996643, -0.12921975553035736, 0.3619426190853119, -0.8209460973739624, -0.5271177291870117, 0.31230926513671875, 0.5042646527290344, -0.264222651720047,...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - polyline: For `polyline`, `pathLength` lets authors specify a total length for the shape, in user units.
[ -0.6491283774375916, -1.2148933410644531, -1.5654016733169556, 0.2925538718700409, -0.1269187182188034, -1.2602910995483398, 0.5501324534416199, 0.08128653466701508, 0.3036602735519409, -0.5884535908699036, -0.6388807892799377, 0.23525887727737427, 0.6141020655632019, -0.6326415538787842, ...
svg/reference/attribute/pathlength/index.md
SVG - Attribute - pathLength - rect: For `rect`, `pathLength` lets authors specify a total length for the rectangle, in user units.
[ -1.2097865343093872, -0.8001627326011658, -0.9101837277412415, 0.8277164101600647, -0.22093640267848969, -1.2851698398590088, 0.5947353839874268, -0.5088430643081665, 0.12479642033576965, -0.7050479054450989, -0.5061016082763672, 0.11763152480125427, 0.5625123381614685, -0.4129942357540130...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve: `import.meta.resolve()` is a built-in function defined on the `import.meta` object of a JavaScript module that resolves a module specifier to a URL using the current module's URL as base.
[ 0.4626043140888214, -0.4501340389251709, -1.089383840560913, 0.8473365902900696, -0.13464637100696564, -0.48727309703826904, 0.6150012016296387, 0.7000779509544373, 0.5722663998603821, -0.25762903690338135, -0.7618667483329773, 0.8175252676010132, -0.5087008476257324, 0.6101498007774353, ...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Syntax: Example: import.meta.resolve(moduleName)
[ 0.6155319809913635, -0.3358059525489807, -0.8687018156051636, 0.12499737739562988, -0.6286011934280396, -0.21810059249401093, 0.8576241731643677, 1.5270204544067383, 0.7165247201919556, -0.5205683708190918, -0.47075989842414856, 0.1370389610528946, -0.36001384258270264, 0.01919891685247421...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Syntax - Parameters: - `moduleName`: A string that specifies a potentially importable module. This may be a relative path (such as `"./lib/helper.js"`), a bare name (such as `"my-module"`), or an absolute URL (such as `"https://example.com/lib/helper.js"`).
[ -0.22720295190811157, -0.5089606046676636, -1.3821707963943481, 0.7003867030143738, -0.17887616157531738, -0.802979588508606, 0.7283934354782104, 0.9675478339195251, -0.014931678771972656, 0.08694774657487869, -0.5272320508956909, 0.4335690140724182, -0.9271386861801147, 0.0537699908018112...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Syntax - Return value: Returns a string corresponding to the path that would be imported if the argument were passed to `import()`.
[ 0.46670374274253845, -0.48832812905311584, -0.5789004564285278, 0.9261580109596252, -0.453317254781723, -0.668716311454773, 0.9185512065887451, 1.539433479309082, 0.41753241419792175, 0.41311538219451904, -0.4187883138656616, 0.37711793184280396, 0.336812824010849, 0.812137246131897, -0....
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Description: `import.meta.resolve()` allows a script to access the module specifier resolution algorithm for a name, like this: Example: // Script at https://example.com/main.js const helperPath = import.meta.resolve("./lib/helper.js"); console.log(helperPath); // "h...
[ 0.037074100226163864, 0.3682264983654022, -0.8150809407234192, 1.0123008489608765, 0.24543803930282593, -0.6545228362083435, -0.046008557081222534, 0.1828863024711609, 0.2351345419883728, 0.2902365028858185, -0.3603377044200897, 0.469971239566803, -0.26704925298690796, 0.6393479704856873, ...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Description - Bare module names: You can pass a bare module name (also known as a bare module specifier) to `import.meta.resolve()`, as long as module resolution is defined for the name. For example, you can define this using an import map inside a browser: Example: <...
[ -0.14538277685642242, -0.8498473167419434, -1.1394764184951782, 1.5365759134292603, -0.1117824912071228, -1.3741966485977173, 0.640093207359314, 0.28654780983924866, -0.12729096412658691, 0.42385631799697876, -0.045411381870508194, 0.49532562494277954, -0.22167855501174927, 0.0484493002295...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Description - Comparison with new URL(): The `URL()` constructor accepts a second base URL argument. When the first argument is a relative path and the base URL is `import.meta.url`, the effect is similar to `import.meta.resolve()`. Example: const helperPath = new URL...
[ -0.17051184177398682, 0.16296784579753876, -0.7671703100204468, 0.6903750896453857, 0.3150922954082489, -0.38357841968536377, -0.0018048826605081558, 0.3144759237766266, 0.013579308986663818, 0.01271246001124382, -0.157666876912117, 0.542017936706543, -0.48678889870643616, 0.71059215068817...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Description - Not an ECMAScript feature: `import.meta.resolve()` is not specified or documented as part of the ECMAScript specification for JavaScript modules. Instead, the specification defines the `import.meta` object but leaves all its properties as "host-defined". T...
[ -0.22895216941833496, -0.5385115146636963, -0.6819809079170227, 0.172297403216362, -0.27891427278518677, -1.1113137006759644, 0.887881875038147, 0.7635518312454224, 0.17636659741401672, 0.4155110716819763, 0.46405667066574097, 0.633876383304596, -0.3012673854827881, -0.08992515504360199, ...
javascript/reference/operators/import.meta/resolve/index.md
JavaScript - Operators - import.meta - resolve - Examples - Resolve a path for the Worker() constructor: `import.meta.resolve()` is particularly valuable for APIs that take a path to a script file as an argument, such as the `Worker()` constructor: Example: // main.js const workerPath = import.meta.resolve("./worker...
[ -0.379838228225708, -0.03856181353330612, -1.0969358682632446, 1.3964499235153198, -0.2530985474586487, -0.2745693027973175, 0.3367467224597931, -0.29541751742362976, 1.0343443155288696, 0.9040320515632629, 0.37504732608795166, 0.3063834607601166, 0.3250017762184143, -0.18263685703277588, ...
javascript/reference/statements/var/index.md
JavaScript - Statements - var: The `var` statement declares function-scoped or globally-scoped variables, optionally initializing each to a value. Example: var x = 1; if (x === 1) { var x = 2; console.log(x); // Expected output: 2 } console.log(x); // Expected output: 2
[ -0.7342118620872498, -0.18370699882507324, -1.8765370845794678, 1.2179139852523804, -0.7558609247207642, -0.8682036399841309, 0.4669034779071808, 1.5222934484481812, 0.004465878009796143, -0.2197137027978897, 0.3591349422931671, -0.46372756361961365, -0.03763978183269501, 0.452034831047058...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Syntax: Example: var name1; var name1 = value1; var name1 = value1, name2 = value2; var name1, name2 = value2; var name1 = value1, name2, /* …, */ nameN = valueN; - `nameN`: The name of the variable to declare. Each must be a legal JavaScript identifier or a destructuring binding patt...
[ 0.12381875514984131, 0.10970849543809891, -0.7961677312850952, 0.6833904385566711, -0.579763650894165, -1.7211054563522339, 1.463874340057373, 1.2112534046173096, -0.27093249559402466, -0.41925984621047974, -0.31884753704071045, -0.7373836636543274, -1.0579068660736084, -0.0866986364126205...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Description: The scope of a variable declared with `var` is one of the following curly-brace-enclosed syntaxes that most closely contains the `var` statement: - Function body - Static initialization block Or if none of the above applies: - The current module, for code running in modu...
[ -0.05107368901371956, 0.6386253833770752, -0.7143256068229675, 0.2503895163536072, 0.9441574811935425, -1.4487444162368774, -0.35053354501724243, 0.8858956694602966, 0.13616712391376495, 0.38060858845710754, -0.7522014379501343, -0.20747201144695282, -0.2592981457710266, 0.6027824878692627...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Description - Hoisting: `var` declarations, wherever they occur in a script, are processed before any code within the script is executed. Declaring a variable anywhere in the code is equivalent to declaring it at the top. This also means that a variable can appear to be used before it's...
[ -0.31821689009666443, -0.28181955218315125, -0.8657208681106567, 1.7875616550445557, -0.48299628496170044, -0.9529162049293518, 0.29043570160865784, 1.730147361755371, -0.19619369506835938, -0.012981278821825981, -0.21735785901546478, -0.531578540802002, 0.32447850704193115, 0.058172039687...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Description - Redeclarations: Duplicate variable declarations using `var` will not trigger an error, even in strict mode, and the variable will not lose its value, unless the declaration has an initializer. Example: var a = 1; var a = 2; console.log(a); // 2 var a; console.log(a); // ...
[ 0.155923530459404, 0.13442794978618622, -1.1267621517181396, 0.7374842762947083, 0.35837119817733765, -0.5204753875732422, -0.10942564904689789, 0.6443632245063782, -0.21544550359249115, -0.0628533735871315, -0.060095783323049545, -0.28513985872268677, 0.28826776146888733, 0.68293094635009...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Examples - Declaring and initializing two variables: Example: var a = 0, b = 0;
[ -0.10528656840324402, -0.08104843646287918, -1.0613912343978882, 1.4843132495880127, -1.022117257118225, 0.0031421203166246414, 1.4540014266967773, 2.070340633392334, -0.017511576414108276, -0.45607176423072815, -0.16604822874069214, -0.43793267011642456, 0.4119877517223358, -0.14908838272...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Examples - Assigning two variables with single string value: Example: var a = "A"; var b = a; This is equivalent to: Example: var a, b = a = "A"; Be mindful of the order: Example: var x = y, y = "A"; console.log(x, y); // undefined A Here, `x` and `y` are declared before any c...
[ -0.8322433829307556, 0.10318735986948013, -1.246951937675476, 1.1292849779129028, -0.5528697371482849, -0.29667794704437256, 1.4116497039794922, 1.0124545097351074, 0.40723803639411926, -0.3089413046836853, 0.8989396691322327, -0.327320396900177, 1.0540499687194824, 0.0277181938290596, -...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Examples - Initialization of several variables: Be careful of the `var x = y = 1` syntax — `y` is not actually declared as a variable, so `y = 1` is an unqualified identifier assignment, which creates a global variable in non-strict mode. Example: var x = 0; function f() { var x = y...
[ -0.5613879561424255, 0.20622257888317108, -1.1140440702438354, 1.2094238996505737, -0.2771754860877991, -0.43086814880371094, 0.6712439656257629, 1.5855168104171753, 0.20216131210327148, -0.32802677154541016, -0.31726980209350586, -0.608306884765625, -0.046511948108673096, 0.07427665591239...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Examples - Implicit globals and outer function scope: Variables that appear to be implicit globals may be references to variables in an outer function scope: Example: var x = 0; // Declares x within file scope, then assigns it a value of 0. console.log(typeof z); // "undefined", sinc...
[ -1.6361238956451416, 0.5181788802146912, -1.066676139831543, 1.2751485109329224, 0.028089284896850586, -0.8901116847991943, 0.6875039935112, 0.10448667407035828, 0.1546780914068222, -0.3109096586704254, 0.05559437721967697, 0.23203250765800476, 0.03954784572124481, 0.3991550803184509, -0...
javascript/reference/statements/var/index.md
JavaScript - Statements - var - Examples - Declaration with destructuring: The left-hand side of each `=` can also be a binding pattern. This allows creating multiple variables at once. Example: const result = /(a+)(b+)(c+)/.exec("aaabcc"); var [, a, b, c] = result; console.log(a, b, c); // "aaa" "b" "cc" For more ...
[ 0.057796381413936615, -0.2257971167564392, -1.6287282705307007, 1.3265645503997803, -1.0097167491912842, -0.9486024975776672, 0.8085750937461853, 1.6532849073410034, 0.43368107080459595, 0.028460508212447166, -0.2927115261554718, 0.6421363949775696, 0.18383653461933136, 0.2004043161869049,...
javascript/reference/statements/for/index.md
JavaScript - Statements - for: The `for` statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement (usually a block statement) to be executed in the loop. Example: let str = ""; for (let i = 0; i < 9; i++) { str += i; } cons...
[ -0.7285122871398926, 0.1489475816488266, -0.8215598464012146, 1.257370114326477, -0.3386235237121582, -1.1627391576766968, 0.07836293429136276, 1.481436848640442, 0.24906891584396362, -0.028319433331489563, 0.17796801030635834, 0.10976003110408783, -0.4129282534122467, 0.2458469271659851, ...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Syntax: Example: for (initialization; condition; afterthought) statement - `initialization` (optional): An expression (including assignment expressions) or variable declaration evaluated once before the loop begins. Typically used to initialize a counter variable. This expression ma...
[ 0.021014191210269928, -0.01709119975566864, -0.7179752588272095, 0.7947035431861877, -0.2726253271102905, -1.9482569694519043, 1.7003194093704224, 1.6565511226654053, 0.5525528788566589, -0.16377970576286316, -0.25420546531677246, -0.4611295163631439, -0.41617414355278015, 0.68781137466430...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Description: Like other looping statements, you can use control flow statements inside `statement`: - `break` stops `statement` execution and goes to the first statement after the loop. - `continue` stops `statement` execution and re-evaluates `afterthought` then `condition`.
[ -0.7925095558166504, 0.4376857280731201, -1.2553772926330566, 1.279861569404602, -0.601712167263031, -1.2650331258773804, 0.518100380897522, 1.9916951656341553, 0.012629054486751556, 0.4821659028530121, -0.027858439832925797, -0.9829066395759583, 0.1460961550474167, 0.11945013701915741, ...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Examples - Using for: The following `for` statement starts by declaring the variable `i` and initializing it to `0`. It checks that `i` is less than nine, performs the two succeeding statements, and increments `i` by 1 after each pass through the loop. Example: for (let i = 0; i < 9; ...
[ -0.7868842482566833, 0.03076409548521042, -0.9991967082023621, 1.6217398643493652, -0.8929334282875061, -0.6197249293327332, 0.788414478302002, 1.6672624349594116, -0.5274985432624817, -0.2432125210762024, 0.08487681299448013, -0.1643255352973938, -0.8676252961158752, 0.46814000606536865, ...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Examples - Initialization block syntax: The initialization block accepts both expressions and variable declarations. However, expressions cannot use the `in` operator unparenthesized, because that is ambiguous with a `for...in` loop. Example: for (let i = "start" in window ? window.st...
[ 0.5083367228507996, 0.6729974746704102, -0.7581373453140259, 1.588769793510437, -0.463549941778183, -0.9700710773468018, 0.24291101098060608, 2.0070643424987793, 0.27686119079589844, -0.037980157881975174, 0.10692541301250458, -0.32323968410491943, 0.2609941065311432, 0.01935303956270218, ...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Examples - Optional for expressions: All three expressions in the head of the `for` loop are optional. For example, it is not required to use the `initialization` block to initialize variables: Example: let i = 0; for (; i < 9; i++) { console.log(i); // more statements } Like the...
[ -0.3746320605278015, 0.07910176366567612, -0.9000749588012695, 1.3135643005371094, -0.1181938648223877, -1.4831417798995972, 1.1245081424713135, 1.1960326433181763, -0.016991667449474335, -0.15342354774475098, -0.1394476294517517, -0.6286090612411499, -0.13180431723594666, 0.51354020833969...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Examples - Lexical declarations in the initialization block: Declaring a variable within the initialization block has important differences from declaring it in the upper scope, especially when creating a closure within the loop body. For example, for the code below: Example: for (let...
[ 0.12544584274291992, -0.006773363333195448, -0.5577078461647034, 0.569168210029602, 0.8245114684104919, -0.464241087436676, 0.05369828641414642, 1.0462145805358887, -0.2051161229610443, 0.06387247145175934, -0.07335267961025238, -0.5239629745483398, -0.6676126718521118, 0.4471322298049927,...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Examples - Using for without a body: The following `for` cycle calculates the offset position of a node in the `afterthought` section, and therefore it does not require the use of a `statement` section, a semicolon is used instead. Example: function showOffsetPos(id) { let left = 0;...
[ -0.6556501388549805, -0.9635211825370789, -0.9889795184135437, 0.8888003826141357, 0.17665070295333862, -1.73603355884552, 1.4496183395385742, 1.1257153749465942, -0.18384690582752228, -0.6234422326087952, 0.07733660936355591, -0.2631710469722748, -0.4198780357837677, 0.5322871208190918, ...
javascript/reference/statements/for/index.md
JavaScript - Statements - for - Examples - Using for with two iterating variables: You can create two counters that are updated simultaneously in a for loop using the comma operator. Multiple `let` and `var` declarations can also be joined with commas. Example: const arr = [1, 2, 3, 4, 5, 6]; for (let l = 0, r = arr...
[ -0.5944399237632751, 0.1893385946750641, -0.5263967514038086, 1.2362902164459229, 0.004310794174671173, -0.5907950401306152, 0.11844266951084137, 1.477001667022705, -0.5668795108795166, 0.08852947503328323, 0.23246866464614868, 0.06063041836023331, -0.11784566193819046, 0.36774954199790955...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array: The `Array` object, as with arrays in other programming languages, enables storing a collection of multiple items under a single variable name, and has members for performing common array operations.
[ 0.04703817144036293, -0.3936004936695099, -1.5497139692306519, 0.8736543655395508, -0.27796798944473267, -1.6405164003372192, -0.08129698038101196, 0.6344780921936035, -0.3160483241081238, -0.27668502926826477, -0.5798024535179138, -0.24401208758354187, -0.5014349222183228, 0.2515754997730...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description: In JavaScript, arrays aren't primitives but are instead `Array` objects with the following core characteristics: - JavaScript arrays are resizable and can contain a mix of different data types. (When those characteristics are undesirable, use typed arrays instead.) -...
[ -0.06984087824821472, -0.22751504182815552, -0.7383595108985901, 1.084787368774414, 0.26726335287094116, -0.9082251787185669, 0.5848051905632019, 0.4297603964805603, -0.7563366293907166, -0.21098899841308594, -0.5042346119880676, -0.40821292996406555, -0.3590890169143677, -0.00951140001416...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Array indices: `Array` objects cannot use arbitrary strings as element indexes (as in an associative array) but must use nonnegative integers (or their respective string form). Setting or accessing via non-integers will not set or retrieve an element from the array l...
[ -0.19365637004375458, -0.04380965977907181, -0.7863766551017761, 1.044170618057251, 0.24554115533828735, -2.0584540367126465, 0.3436366617679596, -0.2231941819190979, -0.5767614841461182, 0.04800724610686302, -0.6500031352043152, 0.5245094299316406, -0.34862831234931946, -0.035067610442638...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Relationship between length and numerical properties: A JavaScript array's `length` property and numerical properties are connected. Several of the built-in array methods (e.g., `join()`, `slice()`, `indexOf()`, etc.) take into account the value of an array's `lengt...
[ -0.06457815319299698, -0.5424365401268005, -0.3777136206626892, 0.008634235709905624, 0.07963649928569794, -0.6277132034301758, 0.46905115246772766, 0.4439202547073364, -0.24862872064113617, -0.08846179395914078, -0.4069797098636627, 0.322746217250824, -0.7727280259132385, 0.30518925189971...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Array methods and empty slots: Array methods have different behaviors when encountering empty slots in sparse arrays. In general, older methods (e.g., `forEach`) treat empty slots differently from indices that contain `undefined`. Methods that have special treatment...
[ -0.750320315361023, -0.4357413351535797, -0.8636221289634705, 0.34950995445251465, 0.32546135783195496, -0.8996129035949707, 0.6613481640815735, 1.355483055114746, -0.13108186423778534, 0.5915440320968628, -0.15099263191223145, -0.08887986838817596, 0.49093860387802124, 0.16312016546726227...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Copying methods and mutating methods: Some methods do not mutate the existing array that the method was called on, but instead return a new array. They do so by first constructing a new array and then populating it with elements. The copy always happens shallowly — t...
[ 0.3863700330257416, 0.44937705993652344, -0.4073985517024994, 0.940896213054657, 0.9465467929840088, -0.536802351474762, -0.06834546476602554, 0.8241568803787231, -0.38215208053588867, 0.2706772983074188, -0.4158674478530884, -0.18328599631786346, -0.6684203147888184, 0.37554773688316345, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Iterative methods: Many array methods take a callback function as an argument. The callback function is called sequentially and at most once for each element in the array, and the return value of the callback function is used to determine the return value of the meth...
[ -0.3026556074619293, 0.23934313654899597, -0.05351599305868149, 0.6100157499313354, 0.7011695504188538, -0.33084192872047424, 0.54052734375, 0.9646897315979004, -0.9034321308135986, -0.07004095613956451, -0.2794552147388458, 0.7114174962043762, -0.26127421855926514, 0.6718589067459106, -...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Generic array methods: Array methods are always generic — they don't access any internal data of the array object. They only access the array elements through the `length` property and the indexed elements. This means that they can be called on array-like objects as ...
[ -0.8891168832778931, -0.23117998242378235, -1.048102617263794, 0.5894052386283875, 0.21808454394340515, -1.697526454925537, 0.08700482547283173, 0.6269481778144836, -0.47564777731895447, -0.2633686065673828, -0.7659392356872559, 0.1548815816640854, -0.10818750411272049, 0.15577755868434906...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Generic array methods - Normalization of the length property: The `length` property is converted to an integer and then clamped to the range between 0 and 253 - 1. `NaN` becomes `0`, so even when `length` is not present or is `undefined`, it behaves as if it has valu...
[ -0.6237623691558838, -0.2198789417743683, -1.0558674335479736, 0.10900714993476868, -0.260231614112854, -1.0439108610153198, -0.007913898676633835, 0.6329010725021362, -0.4832448363304138, 0.04715042561292648, -1.129646897315979, 0.9600980281829834, 0.10779830813407898, -0.5784752368927002...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Description - Generic array methods - Array-like objects: The term array-like object refers to any object that doesn't throw during the `length` conversion process described above. In practice, such object is expected to actually have a `length` property and to have indexed elemen...
[ -0.3524583578109741, -0.3972272574901581, -1.4510138034820557, 0.9955964088439941, 0.18812546133995056, -1.0659936666488647, -0.06021945923566818, 1.2504165172576904, -0.06322614848613739, -0.7618688344955444, -0.3463652729988098, 0.4913424849510193, -0.5874351859092712, -0.133417367935180...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Constructor: - `Array()`: Creates a new `Array` object.
[ -0.22130648791790009, -0.14874188601970673, -1.2174087762832642, 0.6580982208251953, -0.3166705369949341, -1.4388734102249146, -0.3795303404331207, 1.1188380718231201, -0.1856643259525299, 0.14000526070594788, -0.4169563949108124, -0.3970605134963989, -0.49445852637290955, 0.26025807857513...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Static properties: - `Array[Symbol.species]`: Returns the `Array` constructor.
[ -0.5678950548171997, 0.10734770447015762, -0.8057119250297546, 0.251645028591156, -0.7935791611671448, -1.9226714372634888, 0.04938260465860367, 0.9290090203285217, -0.17569951713085175, 0.36759230494499207, -0.48905813694000244, 0.6261135339736938, 0.029095765203237534, 0.2436536848545074...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Static methods: - `Array.from()`: Creates a new `Array` instance from an iterable or array-like object. - `Array.fromAsync()`: Creates a new `Array` instance from an async iterable, iterable, or array-like object. - `Array.isArray()`: Returns `true` if the argument is an array, or...
[ 0.3194992244243622, -0.4300987124443054, -0.3625447154045105, 1.1208488941192627, 0.026153557002544403, -1.7755151987075806, 0.33931711316108704, 1.002601981163025, 0.41321662068367004, 0.7902165651321411, -0.6737164258956909, -0.5875229835510254, -0.12451127171516418, 0.22407463192939758,...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Instance properties: These properties are defined on `Array.prototype` and shared by all `Array` instances. - `Array.prototype.constructor`: The constructor function that created the instance object. For `Array` instances, the initial value is the `Array` constructor. - `Array.pr...
[ -0.36633777618408203, -0.6497914791107178, -0.9315280318260193, 0.8431156277656555, 0.16192564368247986, -2.079955816268921, 0.23979392647743225, 0.9701446294784546, 0.4268330931663513, 0.3655843138694763, -0.40403681993484497, 0.5403960943222046, -0.5598872303962708, 0.479913592338562, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Instance methods: - `Array.prototype.at()`: Returns the array item at the given index. Accepts negative integers, which count back from the last item. - `Array.prototype.concat()`: Returns a new array that is the calling array joined with other array(s) and/or value(s). - `Array.p...
[ -0.1554991900920868, 0.06451268494129181, -0.6255831122398376, 0.35713231563568115, 0.22415366768836975, -0.5050229430198669, 0.5735270380973816, 0.6115190386772156, 0.061760738492012024, -0.5124790668487549, -0.3580193519592285, 0.06279133260250092, -0.11846625059843063, 0.357049673795700...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples: This section provides some examples of common array operations in JavaScript. Note: If you're not yet familiar with array basics, consider first reading JavaScript First Steps: Arrays, which explains what arrays are, and includes other examples of common array operation...
[ 0.146845281124115, 0.2580223083496094, -1.266687035560608, 0.9462518095970154, -0.21988552808761597, -0.8432300686836243, 0.7702682614326477, 0.7154993414878845, -0.6086549162864685, -0.03669951856136322, -0.29673537611961365, -0.47531944513320923, -0.1392408311367035, -0.2577395737171173,...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Create an array: This example shows three ways to create new array: first using array literal notation, then using the `Array()` constructor, and finally using `String.prototype.split()` to build the array from a string. Example: // 'fruits' array created using array ...
[ -0.25353893637657166, 0.08328347653150558, -0.3256017863750458, 0.9776321649551392, 0.2511267364025116, -0.7246043682098389, -0.34055981040000916, 0.6194678544998169, -0.18509416282176971, 0.21227407455444336, -0.12244253605604172, 0.35345298051834106, -0.7512280344963074, 0.38468548655509...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Create a string from an array: This example uses the `join()` method to create a string from the `fruits` array. Example: const fruits = ["Apple", "Banana"]; const fruitsString = fruits.join(", "); console.log(fruitsString); // "Apple, Banana"
[ 0.1766713708639145, -0.010110322386026382, -0.9789004325866699, 0.7490935921669006, -0.01079123467206955, -1.1179437637329102, 0.339243084192276, 0.3394891321659088, -0.6793091297149658, -0.1568394899368286, -0.46747925877571106, 0.14278370141983032, -0.7902143001556396, 0.0995780378580093...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Access an array item by its index: This example shows how to access items in the `fruits` array by specifying the index number of their position in the array. Example: const fruits = ["Apple", "Banana"]; // The index of an array's first element is always 0. fruits[0]...
[ -0.0607437863945961, -0.12807700037956238, -0.6740257740020752, 0.5269567370414734, -0.4647354185581207, -0.6686695218086243, 1.0291507244110107, -0.030214102938771248, -0.3018912076950073, 0.022870291024446487, -0.34109774231910706, 0.23175635933876038, -0.7870805859565735, 0.516151309013...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Find the index of an item in an array: This example uses the `indexOf()` method to find the position (index) of the string `"Banana"` in the `fruits` array. Example: const fruits = ["Apple", "Banana"]; console.log(fruits.indexOf("Banana")); // 1
[ -0.5811922550201416, -0.4793139398097992, -1.0850591659545898, 0.6911559104919434, -0.1463944911956787, -0.9681486487388611, 0.5652757883071899, 0.39864253997802734, 0.04486288130283356, -0.35776519775390625, -0.6714218854904175, 0.04175156354904175, -0.5228025913238525, 0.5018500089645386...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Check if an array contains a certain item: This example shows two ways to check if the `fruits` array contains `"Banana"` and `"Cherry"`: first with the `includes()` method, and then with the `indexOf()` method to test for an index value that's not `-1`. Example: cons...
[ -0.6909627914428711, -0.6783934235572815, -0.8884242177009583, 0.7457387447357178, -0.2407495677471161, -0.8592628836631775, 0.9028962254524231, 0.4452802836894989, -0.1539425551891327, -0.04122238606214523, -0.4167720079421997, -0.006289791315793991, -0.4483930170536041, 0.713371336460113...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Append an item to an array: This example uses the `push()` method to append a new string to the `fruits` array. Example: const fruits = ["Apple", "Banana"]; const newLength = fruits.push("Orange"); console.log(fruits); // ["Apple", "Banana", "Orange"] console.log(newL...
[ -0.4128384590148926, -0.1783803254365921, -0.9781396389007568, 0.7643802165985107, -0.3722571134567261, -1.4456700086593628, 0.833452582359314, 0.4642225503921509, -0.38118433952331543, -0.23327380418777466, -0.6967180371284485, 0.47397756576538086, -0.4070194363594055, 0.4245465099811554,...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Remove the last item from an array: This example uses the `pop()` method to remove the last item from the `fruits` array. Example: const fruits = ["Apple", "Banana", "Orange"]; const removedItem = fruits.pop(); console.log(fruits); // ["Apple", "Banana"] console.log(r...
[ 0.08901707828044891, -0.14077366888523102, -0.8591721653938293, 0.3812345564365387, -0.30877792835235596, -1.6427865028381348, 0.5413855314254761, 0.43909892439842224, -0.7210700511932373, 0.054909296333789825, -0.2514073848724365, 0.4785826802253723, -0.7107657194137573, 0.100058078765869...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Remove multiple items from the end of an array: This example uses the `splice()` method to remove the last 3 items from the `fruits` array. Example: const fruits = ["Apple", "Banana", "Strawberry", "Mango", "Cherry"]; const start = -3; const removedItems = fruits.spli...
[ -0.12805482745170593, -0.1613132506608963, -0.8709918856620789, 0.22992780804634094, -0.333370566368103, -1.384114146232605, 0.4783822298049927, 0.12661989033222198, -0.40191152691841125, 0.17791645228862762, -0.2463311105966568, 0.6466788053512573, -0.8178220987319946, 0.22085067629814148...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Truncate an array down to just its first N items: This example uses the `splice()` method to truncate the `fruits` array down to just its first 2 items. Example: const fruits = ["Apple", "Banana", "Strawberry", "Mango", "Cherry"]; const start = 2; const removedItems =...
[ -0.661471962928772, 0.49645066261291504, -0.2806808352470398, 0.5669557452201843, -0.3073693513870239, -1.4125901460647583, 0.5299058556556702, 0.23157119750976562, -0.7161880731582642, 1.035481572151184, -0.5743997693061829, 0.14483949542045593, -0.6356179714202881, 0.13738635182380676, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Remove the first item from an array: This example uses the `shift()` method to remove the first item from the `fruits` array. Example: const fruits = ["Apple", "Banana"]; const removedItem = fruits.shift(); console.log(fruits); // ["Banana"] console.log(removedItem); ...
[ 0.2272496372461319, -0.029749494045972824, -1.1527003049850464, 0.43499457836151123, -0.08640669286251068, -1.6268011331558228, 0.5103242993354797, 0.8101716637611389, -0.23008853197097778, 0.04830915480852127, -0.24430765211582184, -0.25771886110305786, -1.2159496545791626, -0.03919351473...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Remove multiple items from the beginning of an array: This example uses the `splice()` method to remove the first 3 items from the `fruits` array. Example: const fruits = ["Apple", "Strawberry", "Cherry", "Banana", "Mango"]; const start = 0; const deleteCount = 3; con...
[ 0.0295463465154171, -0.11432989686727524, -0.7276073098182678, 0.437724769115448, -0.22627700865268707, -1.1573296785354614, 0.6132710576057434, 0.22745364904403687, -0.5591328740119934, 0.37182846665382385, -0.5909250974655151, 0.1475767195224762, -1.2429159879684448, 0.051472008228302, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Add a new first item to an array: This example uses the `unshift()` method to add, at index `0`, a new item to the `fruits` array — making it the new first item in the array. Example: const fruits = ["Banana", "Mango"]; const newLength = fruits.unshift("Strawberry"); ...
[ 0.006870667915791273, 0.0635046437382698, -1.245042324066162, 0.8077394366264343, -0.373189777135849, -1.3285205364227295, 0.7445590496063232, 0.47427821159362793, 0.031844399869441986, -0.11077390611171722, -0.3572247624397278, -0.1311742067337036, -0.756840169429779, 0.2971387207508087, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Remove a single item by index: This example uses the `splice()` method to remove the string `"Banana"` from the `fruits` array — by specifying the index position of `"Banana"`. Example: const fruits = ["Strawberry", "Banana", "Mango"]; const start = fruits.indexOf("Ba...
[ -0.8626573085784912, -0.22614333033561707, -0.6668322682380676, 0.30866140127182007, 0.031357184052467346, -1.340803623199463, 0.5637398362159729, -0.3271992802619934, -0.12171295285224915, 0.33786579966545105, -0.851269006729126, 0.3685068190097809, -0.9232361316680908, 0.5067970752716064...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Remove multiple items by index: This example uses the `splice()` method to remove the strings `"Banana"` and `"Strawberry"` from the `fruits` array — by specifying the index position of `"Banana"`, along with a count of the number of total items to remove. Example: co...
[ -0.8206416368484497, -0.25327515602111816, -0.8056050539016724, 0.792521059513092, 0.023071490228176117, -1.1896828413009644, 0.40365204215049744, -0.32602110505104065, -0.00811900943517685, 0.2976590692996979, -0.6304517984390259, 0.7142828106880188, -0.9145737886428833, 0.587098598480224...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Replace multiple items in an array: This example uses the `splice()` method to replace the last 2 items in the `fruits` array with new items. Example: const fruits = ["Apple", "Banana", "Strawberry"]; const start = -2; const deleteCount = 2; const removedItems = fruit...
[ -0.32185420393943787, -0.05326494202017784, -0.6353971362113953, 0.785679280757904, -0.18882107734680176, -1.3950337171554565, 0.38302868604660034, 0.19169875979423523, -0.304637610912323, -0.06140420585870743, -0.11854072660207748, 0.2847391366958618, -0.6771196126937866, 0.52917766571044...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Iterate over an array: This example uses a `for...of` loop to iterate over the `fruits` array, logging each item to the console. Example: const fruits = ["Apple", "Mango", "Cherry"]; for (const fruit of fruits) { console.log(fruit); } // Apple // Mango // Cherry Bu...
[ -0.06661220639944077, -0.35462242364883423, -0.3068080544471741, 1.186309576034546, 0.015306569635868073, -1.268686056137085, 0.457864910364151, 0.45088669657707214, -1.076469898223877, -0.13754397630691528, 0.5004437565803528, 0.11175210773944855, -0.94541996717453, 0.8383768200874329, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Call a function on each element in an array: This example uses the `forEach()` method to call a function on each element in the `fruits` array; the function causes each item to be logged to the console, along with the item's index number. Example: const fruits = ["App...
[ 0.49623793363571167, -0.2795320749282837, -1.2970354557037354, 0.1743408888578415, -0.07109352201223373, -1.4692561626434326, 0.43208855390548706, 0.3888099491596222, -1.0686593055725098, -0.452396959066391, -0.09478852897882462, 0.5910369157791138, -0.43691498041152954, 0.2586037516593933...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Merge multiple arrays together: This example uses the `concat()` method to merge the `fruits` array with a `moreFruits` array, to produce a new `combinedFruits` array. Notice that `fruits` and `moreFruits` remain unchanged. Example: const fruits = ["Apple", "Banana", ...
[ 0.02204062044620514, -0.08192846179008484, -1.2585595846176147, 0.48235076665878296, -0.4656828045845032, -0.6232365369796753, -0.08794885873794556, 0.5411845445632935, -0.5563591122627258, 0.34789976477622986, -0.3613538146018982, 0.18278668820858002, -0.5268427133560181, 0.48972648382186...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Copy an array: This example shows three ways to create a new array from the existing `fruits` array: first by using spread syntax, then by using the `from()` method, and then by using the `slice()` method. Example: const fruits = ["Strawberry", "Mango"]; // Create a ...
[ 0.01470005139708519, 0.2977205514907837, 0.0031901169568300247, 1.0636754035949707, 0.38492831587791443, -0.45244958996772766, -0.03772657737135887, 1.3690357208251953, -0.12254604697227478, -0.06981161236763, -0.45614752173423767, -0.08626729995012283, -0.7061747312545776, 0.5738821029663...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Creating a two-dimensional array: The following creates a chessboard as a two-dimensional array of strings. The first move is made by copying the `'p'` in `board[6][4]` to `board[4][4]`. The old position at `[6][4]` is made blank. Example: const board = [ ["R", "N",...
[ -0.2727666199207306, 0.38908228278160095, -0.9787896275520325, 0.4098331332206726, -0.07042272388935089, -0.6530340313911438, 0.7942656874656677, -0.1348242163658142, -0.06726589053869247, 0.5975367426872253, 0.1723267287015915, 0.34234267473220825, 0.2215881645679474, -0.15817484259605408...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Using an array to tabulate a set of values: Example: const values = []; for (let x = 0; x < 10; x++) { values.push([2 ** x, 2 * x ** 2]); } console.table(values); Results in Example: // The first column is the index 0 1 0 1 2 2 2 4 8 3 8 18 4 16 ...
[ -0.5189036130905151, -0.2806674838066101, -1.2887585163116455, 1.098350167274475, -0.3215092718601227, -0.8629153370857239, 0.7862810492515564, 0.5259079933166504, 0.14128129184246063, 0.44941648840904236, -0.39545565843582153, 0.3267737627029419, -0.0378601998090744, 0.07368962466716766, ...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Creating an array using the result of a match: The result of a match between a `RegExp` and a string can create a JavaScript array that has properties and elements which provide information about the match. Such an array is returned by `RegExp.prototype.exec()` and `Str...
[ -0.38221272826194763, 0.08070996403694153, -0.9156630039215088, 0.3161347508430481, 0.07504554092884064, -0.7078241109848022, 0.13877061009407043, 0.5824271440505981, 0.13845409452915192, -0.6712319254875183, -0.21098744869232178, 0.5829281806945801, -0.2845275402069092, 0.2109359800815582...
javascript/reference/global_objects/array/index.md
JavaScript - Global Objects - Array - Examples - Mutating initial array in iterative methods: Iterative methods do not mutate the array on which it is called, but the function provided as `callbackFn` can. The key principle to remember is that only indexes between 0 and `arrayLength - 1` are visited, where `arrayLengt...
[ 0.41489177942276, 0.5506654381752014, -0.341548353433609, 0.3140881657600403, 1.2805980443954468, -0.9650440216064453, 0.6963351368904114, 1.437888503074646, -0.960132896900177, 0.21077769994735718, -0.32909879088401794, 1.0043574571609497, -0.28099164366722107, 0.5225911736488342, -0.84...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map: The `map()` method of `Array` instances creates a new array populated with the results of calling a provided function on every element in the calling array. Example: const array = [1, 4, 9, 16]; // Pass a function to map const mapped = array.map((x) => x * 2); console.log...
[ 0.3610481321811676, -0.6320851445198059, -1.3108773231506348, 0.5493134260177612, -0.010482139885425568, -1.4931539297103882, -0.04901401326060295, 0.3391346335411072, -0.3659234344959259, 0.3660411834716797, -0.06296394020318985, 0.35049790143966675, 0.14086349308490753, 0.121144816279411...
javascript/reference/global_objects/array/map/index.md
JavaScript - Global Objects - Array - map - Syntax: Example: map(callbackFn) map(callbackFn, thisArg)
[ -0.18187202513217926, 0.3129661977291107, -0.6572860479354858, -0.17496754229068756, -0.7812426090240479, -2.2582383155822754, 1.2661772966384888, 0.8057456612586975, -0.7354794144630432, 0.05267034098505974, -0.3342239558696747, 0.7329721450805664, -0.2961786687374115, 0.8130298852920532,...