file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/errors/bigint_negative_exponent/index.md | JavaScript - Errors - BigInt negative exponent - Error type:
`RangeError`. | [
-1.321169137954712,
-0.15645675361156464,
-1.110705852508545,
-0.3720032870769501,
0.09623545408248901,
-0.9528898000717163,
0.24336567521095276,
1.9783451557159424,
-0.7127587199211121,
-1.3304399251937866,
0.1252714842557907,
-0.05766037851572037,
-0.6122311949729919,
-0.1991780996322631... |
javascript/reference/errors/bigint_negative_exponent/index.md | JavaScript - Errors - BigInt negative exponent - What went wrong?:
The exponent of an exponentiation operation must be positive. Since negative exponents would take the reciprocal of the base, the result will be between -1 and 1 in almost all cases, which gets rounded to `0n`. To catch mistakes, negative exponents are... | [
-1.1559361219406128,
-0.113854318857193,
-1.4285385608673096,
-0.1224028617143631,
0.4729301631450653,
-1.2562942504882812,
-0.2507571578025818,
0.612653374671936,
-0.2849962115287781,
-0.23159311711788177,
-1.1282879114151,
0.1786109060049057,
-0.5131012201309204,
-0.15250705182552338,
... |
javascript/reference/errors/bigint_negative_exponent/index.md | JavaScript - Errors - BigInt negative exponent - Examples - Using a negative BigInt as exponent:
Example:
const a = 1n;
const b = -1n;
const c = a ** b;
// RangeError: BigInt negative exponent
Instead, check if the exponent is negative first, and either issue an error with a better message, or fallback to a differen... | [
-1.1993955373764038,
0.12040621787309647,
-1.0425186157226562,
0.06989146769046783,
0.39126327633857727,
-1.223347783088684,
0.5220135450363159,
0.9600853323936462,
-0.4951413869857788,
-0.3245150148868561,
-0.269386351108551,
0.017012933269143105,
0.0035669554490596056,
-0.138117775321006... |
javascript/reference/errors/array_sort_argument/index.md | JavaScript - Errors - Array sort argument:
The JavaScript exception "invalid Array.prototype.sort argument" occurs when the argument of `Array.prototype.sort()` (and its related methods: `Array.prototype.toSorted()`, `TypedArray.prototype.sort()`, `TypedArray.prototype.toSorted()`) isn't either `undefined` or a functi... | [
-0.22175335884094238,
-0.4431864619255066,
-0.6107409596443176,
0.7636398077011108,
-0.2249029278755188,
-0.9824956059455872,
-0.3474290072917938,
0.7964059710502625,
-0.5888844728469849,
-0.21285536885261536,
-0.09951535612344742,
-1.1375770568847656,
-0.13648849725723267,
-0.771480262279... |
javascript/reference/errors/array_sort_argument/index.md | JavaScript - Errors - Array sort argument - Message:
Example:
TypeError: The comparison function must be either a function or undefined (V8-based)
TypeError: invalid Array.prototype.sort argument (Firefox)
TypeError: non-function passed to Array.prototype.toSorted (Firefox)
TypeError: invalid %TypedArray%.prototype.... | [
-0.7878298759460449,
-0.6795598864555359,
-1.1636911630630493,
-0.5081521272659302,
-0.23428545892238617,
-0.08405360579490662,
0.03850210830569267,
0.9762294292449951,
-0.06285755336284637,
0.23911356925964355,
0.3115597069263458,
-0.9531757235527039,
-0.3008626401424408,
-0.1596516221761... |
javascript/reference/errors/array_sort_argument/index.md | JavaScript - Errors - Array sort argument - Error type:
`TypeError` | [
-0.24414247274398804,
-0.5601449012756348,
-0.726208508014679,
0.13419197499752045,
-0.4582308530807495,
0.47699540853500366,
0.7005627751350403,
1.9343218803405762,
-0.5149223804473877,
-0.49285608530044556,
0.7947472333908081,
-0.8890519738197327,
-0.403351366519928,
-0.346399188041687,
... |
javascript/reference/errors/array_sort_argument/index.md | JavaScript - Errors - Array sort argument - What went wrong?:
The argument of `Array.prototype.sort()` (and its related methods: `Array.prototype.toSorted()`, `TypedArray.prototype.sort()`, `TypedArray.prototype.toSorted()`) is expected to be either `undefined` or a function which compares its operands. | [
-0.4359980821609497,
-0.11691030859947205,
-1.0104128122329712,
-0.01809271052479744,
-0.23524421453475952,
-0.44376274943351746,
-0.45372018218040466,
1.2066688537597656,
0.09731542319059372,
0.1933385133743286,
-0.07627016305923462,
-1.1771714687347412,
-0.34729260206222534,
-0.788847923... |
javascript/reference/errors/array_sort_argument/index.md | JavaScript - Errors - Array sort argument - Examples - Invalid cases:
Example:
[1, 3, 2].sort(5); // TypeError
students.toSorted("name"); // TypeError | [
0.06254499405622482,
-0.2976486384868622,
-0.26732221245765686,
0.022792089730501175,
-0.2831727862358093,
-0.2991921901702881,
0.0488940067589283,
1.7095201015472412,
-1.2353341579437256,
0.06679105758666992,
0.429307758808136,
-1.0382798910140991,
-0.5494449734687805,
-0.7565867304801941... |
javascript/reference/errors/array_sort_argument/index.md | JavaScript - Errors - Array sort argument - Examples - Valid cases:
Example:
[1, 3, 2].sort(); // [1, 2, 3]
[1, 3, 2].sort((a, b) => a - b); // [1, 2, 3]
students.toSorted((a, b) => a.name.localeCompare(b.name)); | [
0.28618544340133667,
0.139173224568367,
-0.43171975016593933,
-0.3288955092430115,
-0.24062363803386688,
-0.22277499735355377,
0.3379608988761902,
1.3115274906158447,
-0.9906818270683289,
-0.1669444739818573,
0.30991411209106445,
-0.36856991052627563,
-0.08803057670593262,
-0.7482106089591... |
javascript/reference/errors/super_called_twice/index.md | JavaScript - Errors - Super called twice:
The JavaScript exception "super() called twice in derived class constructor" occurs when the `super()` is called a second time for a given derived class constructor. | [
-0.33289697766304016,
0.052992597222328186,
-1.2407166957855225,
1.2250515222549438,
-0.39745470881462097,
-0.8064519762992859,
0.4433077871799469,
0.32830503582954407,
-1.808716893196106,
0.02924725040793419,
-0.8214581608772278,
-0.4555605947971344,
-0.6309012770652771,
-0.37850838899612... |
javascript/reference/errors/super_called_twice/index.md | JavaScript - Errors - Super called twice - Message:
Example:
ReferenceError: Super constructor may only be called once (V8-based)
ReferenceError: super() called twice in derived class constructor (Firefox)
ReferenceError: 'super()' can't be called more than once in a constructor. (Safari) | [
-0.8593522906303406,
0.2819259762763977,
-1.3052531480789185,
0.8708779811859131,
-0.6093292832374573,
-0.6599319577217102,
0.1396780163049698,
0.3717038333415985,
-2.0343925952911377,
0.041093047708272934,
-0.3918544352054596,
-0.21932077407836914,
0.11893963813781738,
-0.9684581160545349... |
javascript/reference/errors/super_called_twice/index.md | JavaScript - Errors - Super called twice - Error type:
`ReferenceError` | [
-0.5629305839538574,
0.002880162326619029,
-1.5434610843658447,
0.5049830675125122,
-0.8593102097511292,
0.507304847240448,
1.549454689025879,
1.0523791313171387,
-1.3798542022705078,
-0.13129524886608124,
-0.7045131325721741,
0.07743306457996368,
-0.013936378061771393,
-0.2487061619758606... |
javascript/reference/errors/super_called_twice/index.md | JavaScript - Errors - Super called twice - What went wrong?:
The `super()` call can only be called at most once for each `new` call to a derived class constructor. This is because `super()` is responsible for initializing the parent class, and calling it more than once would result in the parent constructor being call... | [
-0.7286317348480225,
0.2742898762226105,
-1.3665801286697388,
0.9442852735519409,
-0.44367167353630066,
-1.11615788936615,
-0.6323797106742859,
0.6531354188919067,
-1.4321160316467285,
0.7840067148208618,
-0.7285433411598206,
0.02475631609559059,
0.3299758732318878,
-0.5994261503219604,
... |
javascript/reference/errors/super_called_twice/index.md | JavaScript - Errors - Super called twice - Examples - Invalid cases:
Example:
class Base {}
class Derived extends Base {
constructor() {
super();
super();
}
}
Sometimes the bug may be more subtle.
Example:
class Base {
constructor(flavor) {
// Do something with the flavor
}
}
class Derived ex... | [
-0.7323845028877258,
0.0053662569262087345,
-0.6256022453308105,
1.097464919090271,
-0.05176858976483345,
-0.9065572619438171,
0.24518392980098724,
0.8575859069824219,
-1.5418448448181152,
-0.29205524921417236,
0.2101414054632187,
0.5198623538017273,
-0.907107949256897,
-0.5718005299568176... |
javascript/reference/errors/super_called_twice/index.md | JavaScript - Errors - Super called twice - Examples - Valid cases:
Example:
class Base {}
class Derived extends Base {
constructor() {
super();
// More initialization logic
}
} | [
0.506373941898346,
-0.15530121326446533,
-1.0847598314285278,
1.002150297164917,
-0.8721769452095032,
-0.49299073219299316,
0.41521909832954407,
1.1762664318084717,
-1.227744698524475,
-0.24905972182750702,
-0.7292650938034058,
-0.2307114601135254,
-0.5357469320297241,
-0.5170618891716003,... |
javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | JavaScript - Errors - Cant be converted to BigInt because it isnt an integer:
The JavaScript exception "x can't be converted to BigInt because it isn't an integer" occurs when the `BigInt()` function is used on a number that isn't an integer. | [
-0.7770026326179504,
-0.1394978016614914,
-0.7862647175788879,
0.33086010813713074,
-0.8898561596870422,
-1.3713899850845337,
-0.33348938822746277,
0.7223613262176514,
-0.708275318145752,
-0.8379989266395569,
-0.31198298931121826,
-0.6129352450370789,
-0.15990407764911652,
-0.4923219978809... |
javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | JavaScript - Errors - Cant be converted to BigInt because it isnt an integer - Message:
Example:
RangeError: The number 1.5 cannot be converted to a BigInt because it is not an integer (V8-based & Firefox)
RangeError: Not an integer (Safari) | [
-0.7282049059867859,
0.035535071045160294,
-0.8728365302085876,
-0.08666802197694778,
-0.604203462600708,
-1.3027399778366089,
-0.327713280916214,
1.0394002199172974,
-0.044138453900814056,
-0.7310270667076111,
-0.14639823138713837,
-0.3883211314678192,
-0.658968448638916,
-0.6757299900054... |
javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | JavaScript - Errors - Cant be converted to BigInt because it isnt an integer - Error type:
`RangeError`. | [
-0.7346271872520447,
0.17790447175502777,
-1.083642601966858,
-0.4412868320941925,
-0.7176252603530884,
-0.6257275938987732,
-0.43228819966316223,
1.5939832925796509,
-0.5588918328285217,
-1.3321442604064941,
0.3365859389305115,
-0.11830087751150131,
-0.4065134823322296,
-0.295003026723861... |
javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | JavaScript - Errors - Cant be converted to BigInt because it isnt an integer - What went wrong?:
When using the `BigInt()` function to convert a number to a BigInt, the number must be an integer (such that `Number.isInteger` returns true). | [
-0.8478606343269348,
0.037805505096912384,
-0.9702367782592773,
-0.3438188135623932,
-0.5369408130645752,
-1.2802200317382812,
-0.7373442053794861,
0.5020949244499207,
-0.8678722381591797,
-0.4950401782989502,
-0.25841015577316284,
-0.6458132266998291,
0.014477010816335678,
0.1002040430903... |
javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | JavaScript - Errors - Cant be converted to BigInt because it isnt an integer - Examples - Invalid cases:
Example:
const a = BigInt(1.5);
// RangeError: The number 1.5 cannot be converted to a BigInt because it is not an integer
const b = BigInt(NaN);
// RangeError: NaN cannot be converted to a BigInt because it is no... | [
-0.29652121663093567,
-0.10636747628450394,
-0.6414781808853149,
0.16627222299575806,
-0.1432531774044037,
-1.3174149990081787,
-0.6568138003349304,
0.9243767857551575,
-0.4158639907836914,
-0.4906466007232666,
-0.5358134508132935,
-0.31102827191352844,
0.10267414152622223,
-0.517261624336... |
javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | JavaScript - Errors - Cant be converted to BigInt because it isnt an integer - Examples - Valid cases:
Example:
const a = BigInt(1); | [
-0.32489249110221863,
0.5001907348632812,
-0.7376453876495361,
-0.508579671382904,
-0.655339241027832,
-0.7720908522605896,
-0.4699903428554535,
1.1223641633987427,
-0.5082728266716003,
-0.49755701422691345,
-0.10614964365959167,
-0.21248707175254822,
0.18450380861759186,
-0.07865622639656... |
javascript/reference/errors/regex_character_class_escape_in_class_range/index.md | JavaScript - Errors - Regex character class escape in class range:
The JavaScript exception "character class escape cannot be used in class range in regular expression" occurs when a Unicode-aware regular expression pattern contains a character class where a boundary of a character range is another character class, su... | [
-0.45374780893325806,
0.1825616955757141,
-0.9181976914405823,
0.15145140886306763,
0.3815167248249054,
-1.3707817792892456,
-0.3159751892089844,
1.1568603515625,
-0.3228963613510132,
-1.1023080348968506,
-0.17836041748523712,
-0.3145756125450134,
-0.4333152770996094,
-0.9522515535354614,
... |
javascript/reference/errors/regex_character_class_escape_in_class_range/index.md | JavaScript - Errors - Regex character class escape in class range - Message:
Example:
SyntaxError: Invalid regular expression: /[\s-1]/u: Invalid character class (V8-based)
SyntaxError: character class escape cannot be used in class range in regular expression (Firefox)
SyntaxError: Invalid regular expression: invali... | [
-0.7252561450004578,
0.26902303099632263,
-0.9100337028503418,
-0.5398468375205994,
0.49236640334129333,
-1.3187888860702515,
0.31415972113609314,
1.002007007598877,
0.003850460285320878,
-0.3431223928928375,
0.2083280086517334,
-0.2983381450176239,
-0.36873191595077515,
-1.397996187210083... |
javascript/reference/errors/regex_character_class_escape_in_class_range/index.md | JavaScript - Errors - Regex character class escape in class range - Error type:
`SyntaxError` | [
-0.310492604970932,
0.4222029447555542,
-0.3333101272583008,
-0.6094274520874023,
-0.08610287308692932,
-1.1881746053695679,
0.3239339590072632,
2.006484031677246,
-0.22172261774539948,
-1.3710606098175049,
0.40640053153038025,
-0.14589937031269073,
-1.0839749574661255,
-0.5596635937690735... |
javascript/reference/errors/regex_character_class_escape_in_class_range/index.md | JavaScript - Errors - Regex character class escape in class range - What went wrong?:
A character class can specify a range of characters by using a hyphen (`-`) between two characters. For example, `[a-z]` matches any lowercase letter from `a` to `z`. The two bounds of the range must represent single characters in or... | [
-0.8843876719474792,
-0.36044999957084656,
-0.6214326620101929,
-0.024920590221881866,
0.7480195760726929,
-0.8761816620826721,
0.8450950980186462,
0.911448061466217,
-0.1582627296447754,
-0.9917201399803162,
-0.14689329266548157,
0.5392485857009888,
-0.19610369205474854,
-0.98940479755401... |
javascript/reference/errors/regex_character_class_escape_in_class_range/index.md | JavaScript - Errors - Regex character class escape in class range - Examples - Invalid cases:
Example:
/[\s-_]/u; // \s is a character class escape for whitespace
/[A-\D]/u; // \D is a character class escape for non-digits
/[\p{L}-\p{N}]/u; // \p{L} is a character class escape for Unicode letters
/[[A-z]-_]/v; // In ... | [
-1.0531573295593262,
-0.049210209399461746,
-0.9141117334365845,
0.17600305378437042,
0.5893236398696899,
-0.39444661140441895,
0.31131884455680847,
1.2180774211883545,
-0.25964173674583435,
-0.1297828108072281,
0.04207703471183777,
0.2670712471008301,
-0.5412649512290955,
-1.1888803243637... |
javascript/reference/errors/regex_character_class_escape_in_class_range/index.md | JavaScript - Errors - Regex character class escape in class range - Examples - Valid cases:
Example:
// Put the hyphen at the start of the character class,
// so it matches the literal character
/[-\s_]/u;
// Escape the hyphen so it also matches the literal character
/[\s\-_]/u;
// Remove the backslash so the bound i... | [
-1.0903245210647583,
-0.06351121515035629,
-0.3957027494907379,
-0.39399948716163635,
0.4907373785972595,
-0.867318868637085,
0.8621402978897095,
0.7904791235923767,
0.26014626026153564,
-0.703417956829071,
-0.3782297968864441,
-0.17172187566757202,
-0.7105909585952759,
-1.195363998413086,... |
javascript/reference/errors/cant_redefine_property/index.md | JavaScript - Errors - Cant redefine property:
The JavaScript exception "can't redefine non-configurable property" occurs when it was attempted to redefine a property, but that property is non-configurable. | [
-0.4631061851978302,
0.9564146399497986,
-0.7160897254943848,
0.3887852430343628,
-0.4900873899459839,
-1.432030200958252,
0.8909425139427185,
1.047346830368042,
-0.05815334618091583,
-0.28681614995002747,
-0.45413389801979065,
-0.8341070413589478,
-0.5070158839225769,
-0.24893951416015625... |
javascript/reference/errors/cant_redefine_property/index.md | JavaScript - Errors - Cant redefine property - Message:
Example:
TypeError: Cannot redefine property: "x" (V8-based)
TypeError: can't redefine non-configurable property "x" (Firefox)
TypeError: Attempting to change value of a readonly property. (Safari) | [
-0.9743402600288391,
0.6831946969032288,
-0.7150128483772278,
-0.19803085923194885,
-0.7637122273445129,
-0.9642606973648071,
1.2152825593948364,
1.2451462745666504,
0.36131149530410767,
-0.7622188925743103,
0.1100158616900444,
-0.9277213215827942,
-0.37233081459999084,
-0.8332966566085815... |
javascript/reference/errors/cant_redefine_property/index.md | JavaScript - Errors - Cant redefine property - Error type:
`TypeError` | [
-0.48623335361480713,
0.4792574346065521,
-0.7426705360412598,
-0.42767927050590515,
-0.30778828263282776,
-0.3414357006549835,
1.3039262294769287,
2.10378098487854,
0.16939684748649597,
-1.0246837139129639,
0.16215872764587402,
-0.6434535384178162,
-0.22211173176765442,
-0.689142107963562... |
javascript/reference/errors/cant_redefine_property/index.md | JavaScript - Errors - Cant redefine property - What went wrong?:
It was attempted to redefine a property, but that property is non-configurable. The `configurable` attribute controls whether the property can be deleted from the object and whether its attributes (other than `writable`) can be changed. Usually, properti... | [
-0.8397147059440613,
0.46348097920417786,
-0.7768076658248901,
0.4091531038284302,
-0.042613692581653595,
-1.8582134246826172,
0.44996774196624756,
0.8227367997169495,
0.4440097510814667,
-0.10432705283164978,
-0.8259038329124451,
-0.5766620635986328,
-0.41447240114212036,
-0.3040102124214... |
javascript/reference/errors/cant_redefine_property/index.md | JavaScript - Errors - Cant redefine property - Examples - Non-configurable properties created by Object.defineProperty:
The `Object.defineProperty()` creates non-configurable properties if you haven't specified them as configurable.
Example:
const obj = Object.create({});
Object.defineProperty(obj, "foo", { value: "... | [
-0.4086014926433563,
0.4702044427394867,
-1.3128091096878052,
0.6593965291976929,
-0.33852502703666687,
-1.582229495048523,
1.1767101287841797,
0.28714680671691895,
0.10517077147960663,
0.7115705609321594,
-0.578978955745697,
-0.6639098525047302,
0.11304470151662827,
-0.2550143003463745,
... |
javascript/reference/errors/already_executing_generator/index.md | JavaScript - Errors - Already executing generator:
The JavaScript exception "TypeError: already executing generator" occurs when a generator is continued using one of its methods (such as `next()`) while executing the generator function's body itself. | [
0.0752829983830452,
0.2507427930831909,
-1.3096102476119995,
1.198073148727417,
-0.606951117515564,
-1.2873473167419434,
-0.09485369175672531,
1.782982587814331,
-0.9664921164512634,
-0.05825446918606758,
-0.5050423741340637,
-1.766692876815796,
-0.1638275533914566,
-0.3680947721004486,
... |
javascript/reference/errors/already_executing_generator/index.md | JavaScript - Errors - Already executing generator - Message:
Example:
TypeError: Generator is already running (V8-based)
TypeError: already executing generator (Firefox)
TypeError: Generator is executing (Safari) | [
-0.2249884009361267,
0.2694011330604553,
-1.602940320968628,
0.07994142919778824,
-1.0667378902435303,
-1.1246201992034912,
0.08161710202693939,
1.987607717514038,
-0.6010606288909912,
0.06901900470256805,
-0.11453253030776978,
-1.2412433624267578,
0.4113210439682007,
-0.5276662111282349,
... |
javascript/reference/errors/already_executing_generator/index.md | JavaScript - Errors - Already executing generator - Error type:
`TypeError` | [
-0.0925481840968132,
0.7280837297439575,
-1.3115355968475342,
0.12333936989307404,
-1.1080089807510376,
-0.15479601919651031,
0.49712780117988586,
2.312669038772583,
-0.6755325794219971,
-0.14413560926914215,
-0.19364935159683228,
-1.2699757814407349,
0.04816615581512451,
-0.27664834260940... |
javascript/reference/errors/already_executing_generator/index.md | JavaScript - Errors - Already executing generator - What went wrong?:
The generator's methods, `next()`, `return()`, and `throw()`, are meant to continue the execution of a generator function when it's paused after a `yield` expression or before the first statement. If a call to one of these methods is made while exec... | [
0.12886568903923035,
0.15869110822677612,
-1.1375665664672852,
0.5252090692520142,
-0.2881750166416168,
-1.1320618391036987,
-0.3253154456615448,
1.368497371673584,
-1.0380228757858276,
0.23999227583408356,
-0.26307040452957153,
-0.7904535531997681,
-0.36021849513053894,
-0.084453895688056... |
javascript/reference/errors/already_executing_generator/index.md | JavaScript - Errors - Already executing generator - Examples:
Example:
let it;
function* getNumbers(times) {
if (times <= 0) {
it.throw(new Error("times must be greater than 0"));
}
for (let i = 0; i < times; i++) {
yield i;
}
}
it = getNumbers(3);
it.next();
Example:
let it;
function* getNumbers(ti... | [
0.39343157410621643,
0.05749868229031563,
-1.0318628549575806,
0.3254255950450897,
0.2813549041748047,
-0.673862099647522,
-0.20918072760105133,
0.40998372435569763,
-1.0596575736999512,
-0.14587582647800446,
-0.4695624113082886,
-0.08311598002910614,
-0.4502018988132477,
-0.05781012773513... |
javascript/reference/errors/regex_invalid_capture_group_name/index.md | JavaScript - Errors - Regex invalid capture group name:
The JavaScript exception "invalid capture group name in regular expression" occurs when a named capturing group or named backreference contains an invalid identifier. | [
0.3004167377948761,
-0.03719854727387428,
-1.1590533256530762,
0.3431304395198822,
-0.6188541054725647,
-0.8559276461601257,
1.037873387336731,
0.3093982934951782,
-1.5046509504318237,
-0.3581123948097229,
-1.0898619890213013,
-1.8024039268493652,
-0.7742477059364319,
-0.5630528330802917,
... |
javascript/reference/errors/regex_invalid_capture_group_name/index.md | JavaScript - Errors - Regex invalid capture group name - Message:
Example:
SyntaxError: Invalid regular expression: /(?<1>)/: Invalid capture group name (V8-based)
SyntaxError: invalid capture group name in regular expression (Firefox)
SyntaxError: Invalid regular expression: invalid group specifier name (Safari) | [
0.040689561516046524,
0.7057977318763733,
-0.9626538753509521,
-0.16130498051643372,
-0.621626079082489,
-1.1370677947998047,
1.0080221891403198,
0.5566604137420654,
-1.139595627784729,
-0.2928958237171173,
-0.3315180838108063,
-1.4433728456497192,
-0.5686652064323425,
-1.0712530612945557,... |
javascript/reference/errors/regex_invalid_capture_group_name/index.md | JavaScript - Errors - Regex invalid capture group name - Error type:
`SyntaxError` | [
0.14889085292816162,
0.3831556737422943,
-0.32970356941223145,
-0.335070937871933,
-1.1219351291656494,
-0.6217043995857239,
1.0017744302749634,
1.4233731031417847,
-1.1116409301757812,
-1.0591940879821777,
0.19294944405555725,
-1.129091501235962,
-0.47832247614860535,
-0.3588542640209198,... |
javascript/reference/errors/regex_invalid_capture_group_name/index.md | JavaScript - Errors - Regex invalid capture group name - What went wrong?:
Each named capturing group must have a name that is a valid identifier. You cannot use arbitrary strings as the group identifier. | [
0.17969876527786255,
-0.17638085782527924,
-1.2140370607376099,
-0.0003483859181869775,
-0.8815898895263672,
-1.5915226936340332,
0.9151273965835571,
-0.3391236960887909,
-1.4140796661376953,
-0.1304449439048767,
-0.7387269735336304,
-1.8304433822631836,
-1.077074646949768,
-0.848857223987... |
javascript/reference/errors/regex_invalid_capture_group_name/index.md | JavaScript - Errors - Regex invalid capture group name - Examples - Invalid cases:
Example:
/(?<1>\d+) (?<2>\d+)/;
Or you might be building the regex dynamically:
Example:
const tokenTypes = {
"number literal": /\d+/,
"string literal": /".+?"/,
identifier: /[a-zA-Z_]\w*/,
};
const tokenPattern = new RegExp(... | [
0.6202114224433899,
0.49964025616645813,
-0.9909271001815796,
0.11828295141458511,
-0.14607565104961395,
-0.3404739499092102,
0.4623856246471405,
0.33223822712898254,
-0.989891767501831,
-0.3180348575115204,
-0.5137262940406799,
-1.2351675033569336,
-0.3275356888771057,
0.1598174273967743,... |
javascript/reference/errors/regex_invalid_capture_group_name/index.md | JavaScript - Errors - Regex invalid capture group name - Examples - Valid cases:
Example:
/(?<group1>\d+) (?<group2>\d+)/;
If the regex is built dynamically, make sure the names are all valid identifiers. For example:
Example:
const tokenTypes = {
numberLiteral: /\d+/,
stringLiteral: /".+?"/,
identifier: /[a... | [
0.047406893223524094,
0.5488159656524658,
-0.868751585483551,
0.5368807315826416,
-0.4873775839805603,
-0.9010156989097595,
1.0044591426849365,
0.11450938135385513,
-1.2625007629394531,
-0.24684420228004456,
-0.6126351356506348,
-0.7943583130836487,
-0.6697736382484436,
-0.6804819703102112... |
javascript/reference/errors/regex_numbers_out_of_order_in_quantifier/index.md | JavaScript - Errors - Regex numbers out of order in quantifier:
The JavaScript exception "numbers out of order in {} quantifier" occurs when a quantifier in a regular expression uses the `{n,m}` syntax but `m` is less than `n`. | [
0.14098703861236572,
0.14210152626037598,
-1.3863695859909058,
-0.5669847726821899,
-0.35942694544792175,
-0.6028807163238525,
-1.2428110837936401,
0.9396567344665527,
-0.7343544363975525,
-0.24062097072601318,
-0.8855074644088745,
-1.323747992515564,
-0.5321367383003235,
-0.46127438545227... |
javascript/reference/errors/regex_numbers_out_of_order_in_quantifier/index.md | JavaScript - Errors - Regex numbers out of order in quantifier - Message:
Example:
SyntaxError: Invalid regular expression: /1{2,1}/: numbers out of order in {} quantifier (V8-based)
SyntaxError: numbers out of order in {} quantifier. (Firefox)
SyntaxError: Invalid regular expression: numbers out of order in {} quant... | [
-0.18787187337875366,
0.9848901033401489,
-1.5132578611373901,
-1.2414153814315796,
-0.4032208323478699,
-0.9590104818344116,
-0.8565902709960938,
1.2485700845718384,
-0.4459805190563202,
-0.1035350114107132,
-0.3838213086128235,
-0.8930224776268005,
-0.03471244499087334,
-0.53084635734558... |
javascript/reference/errors/regex_numbers_out_of_order_in_quantifier/index.md | JavaScript - Errors - Regex numbers out of order in quantifier - Error type:
`SyntaxError` | [
-0.1618037223815918,
0.5314838886260986,
-0.9335117340087891,
-1.3445191383361816,
-0.9919741153717041,
-0.3985757827758789,
-0.11728671938180923,
1.79000723361969,
-0.6294203996658325,
-0.7218520641326904,
-0.29844364523887634,
-0.9895860552787781,
-0.5107079744338989,
-0.1747128665447235... |
javascript/reference/errors/regex_numbers_out_of_order_in_quantifier/index.md | JavaScript - Errors - Regex numbers out of order in quantifier - What went wrong?:
The `{n,m}` syntax in a regular expression is used to specify that the preceding item is to be matched at least `n` times, but not more than `m` times. If `m` is less than `n`, the quantifier is nonsensical because, for example, a chara... | [
-0.006848970428109169,
0.3833664059638977,
-0.7490625381469727,
-0.9427803754806519,
0.007100037299096584,
-0.6254063844680786,
-0.7916907668113708,
0.5475542545318604,
-0.6176506280899048,
0.02832864411175251,
-0.6479492783546448,
-1.1877449750900269,
-0.07977931946516037,
-0.297491729259... |
javascript/reference/errors/regex_numbers_out_of_order_in_quantifier/index.md | JavaScript - Errors - Regex numbers out of order in quantifier - Examples - Invalid examples:
Example:
/1{2,1}/; | [
0.03529738634824753,
1.1709851026535034,
-1.4512478113174438,
-1.0426160097122192,
-0.6977142691612244,
-0.7570456266403198,
-0.42327073216438293,
1.2128257751464844,
-1.5601747035980225,
-0.5052443146705627,
-0.8637428879737854,
-1.2870967388153076,
-0.23158131539821625,
-0.64917778968811... |
javascript/reference/errors/regex_numbers_out_of_order_in_quantifier/index.md | JavaScript - Errors - Regex numbers out of order in quantifier - Examples - Valid examples:
Example:
/1{1,2}/; | [
0.17996491491794586,
0.8977721333503723,
-1.4779503345489502,
-0.9419405460357666,
-0.47762757539749146,
-0.6156824827194214,
-0.19771406054496765,
1.041133999824524,
-1.444944977760315,
-0.5070397257804871,
-0.7116134166717529,
-1.3236018419265747,
-0.3685847818851471,
-0.5978541374206543... |
javascript/reference/errors/bigint_division_by_zero/index.md | JavaScript - Errors - BigInt division by zero:
The JavaScript exception "BigInt division by zero" occurs when a `BigInt` is divided by `0n`. | [
-0.9952836632728577,
-0.16936472058296204,
-0.8628297448158264,
0.40106725692749023,
-0.2196875810623169,
-0.6486923098564148,
-0.19711659848690033,
0.42894402146339417,
-1.5504192113876343,
-0.6581422686576843,
-0.518757700920105,
-0.9774078130722046,
-0.6803258657455444,
-0.3800178170204... |
javascript/reference/errors/bigint_division_by_zero/index.md | JavaScript - Errors - BigInt division by zero - Message:
Example:
RangeError: Division by zero (V8-based)
RangeError: BigInt division by zero (Firefox)
RangeError: 0 is an invalid divisor value. (Safari) | [
-1.4853391647338867,
0.031823329627513885,
-1.0652787685394287,
-0.13126987218856812,
-0.25602006912231445,
-0.5425103306770325,
0.41485774517059326,
0.45228180289268494,
-0.8976755738258362,
-0.8508017659187317,
-0.21296748518943787,
-0.6129190921783447,
-0.5867992043495178,
-0.5260600447... |
javascript/reference/errors/bigint_division_by_zero/index.md | JavaScript - Errors - BigInt division by zero - Error type:
`RangeError`. | [
-1.1990396976470947,
-0.046140749007463455,
-1.1368504762649536,
-0.24958553910255432,
-0.2278337925672531,
-0.19353678822517395,
0.32782647013664246,
1.4463050365447998,
-1.09605073928833,
-1.3058319091796875,
-0.05110136792063713,
-0.6763660907745361,
-0.9403221607208252,
-0.143832579255... |
javascript/reference/errors/bigint_division_by_zero/index.md | JavaScript - Errors - BigInt division by zero - What went wrong?:
The divisor of a division or remainder operator is `0n`. In `Number` arithmetic, this produces `Infinity`, but there's no "infinity value" in BigInts, so an error is issued. Check if the divisor is `0n` before doing the division. | [
-0.8470648527145386,
0.3083846867084503,
-1.138810396194458,
0.042317360639572144,
0.4963200092315674,
-0.864579439163208,
-0.1623469591140747,
0.6477997899055481,
-0.8704913854598999,
-0.25904884934425354,
-0.8252883553504944,
-0.7471304535865784,
-0.08983282744884491,
-0.3583043217658996... |
javascript/reference/errors/bigint_division_by_zero/index.md | JavaScript - Errors - BigInt division by zero - Examples - Division by 0n:
Example:
const a = 1n;
const b = 0n;
const quotient = a / b;
// RangeError: BigInt division by zero
Instead, check if the divisor is `0n` first, and either issue an error with a better message, or fallback to a different value, like `Infinity... | [
-0.9692707061767578,
0.45094558596611023,
-0.8697346448898315,
0.17636552453041077,
0.24815970659255981,
-0.07187706232070923,
0.32092270255088806,
0.3700265884399414,
-0.8498567938804626,
-0.45664873719215393,
-0.33907076716423035,
-0.7413432002067566,
-0.12375304102897644,
-0.16774751245... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side:
The JavaScript exception "invalid assignment left-hand side" occurs when there was an unexpected assignment somewhere. It may be triggered when a single `=` sign was used instead of `==` or `===`. | [
-0.4971828758716583,
-0.24198155105113983,
-1.426905870437622,
0.28050854802131653,
-0.29403290152549744,
-0.9524031281471252,
0.9304094910621643,
1.8699411153793335,
-0.6174414753913879,
-0.20636031031608582,
-0.3232143521308899,
-0.27601584792137146,
-0.08847814798355103,
-0.277442306280... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side - Message:
Example:
SyntaxError: Invalid left-hand side in assignment (V8-based)
SyntaxError: invalid assignment left-hand side (Firefox)
SyntaxError: Left side of assignment is not a reference. (Safari)
ReferenceError: Invalid left-hand side in assignment (V8-... | [
-1.189538598060608,
0.3788939118385315,
-1.1995956897735596,
-0.22069373726844788,
-0.7342373728752136,
-0.6946848034858704,
1.4814481735229492,
1.8406696319580078,
0.31024855375289917,
-0.3071548640727997,
0.13956481218338013,
-0.08171941339969635,
0.41532599925994873,
0.1195898950099945,... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side - Error type:
`SyntaxError` or `ReferenceError`, depending on the syntax. | [
-0.5615421533584595,
-0.0471547469496727,
-0.9761974811553955,
0.2372949868440628,
-0.614281952381134,
-0.410199373960495,
1.6115821599960327,
2.4941365718841553,
0.7533593773841858,
-1.0095551013946533,
-0.1819542944431305,
-0.024618742987513542,
0.15810999274253845,
-0.01257556676864624,... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side - What went wrong?:
There was an unexpected assignment somewhere. This might be due to a mismatch of an assignment operator and an equality operator, for example. While a single `=` sign assigns a value to a variable, the `==` or `===` operators compare a value. | [
-0.8302804827690125,
-0.45680370926856995,
-1.8282791376113892,
0.03513527661561966,
-0.028347870334982872,
-0.9029989242553711,
0.7183766961097717,
2.00508713722229,
0.34090155363082886,
-0.42194244265556335,
-0.08112560212612152,
-0.7082960605621338,
0.6656073331832886,
0.008304468356072... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side - Examples - Typical invalid assignments:
Example:
if (Math.PI + 1 = 3 || Math.PI + 1 = 4) {
console.log("no way!");
}
// SyntaxError: invalid assignment left-hand side
const str = "Hello, "
+= "is it me "
+= "you're looking for?";
// SyntaxError: invalid ass... | [
-1.120335340499878,
-0.12012196332216263,
-0.975466251373291,
0.24965642392635345,
0.4152924418449402,
-0.5465940237045288,
1.316964864730835,
1.1185888051986694,
0.014913682825863361,
0.2990955114364624,
-0.32278746366500854,
-0.7928724884986877,
0.3310794234275818,
-0.24297568202018738,
... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side - Examples - Assignments producing ReferenceErrors:
Invalid assignments don't always produce syntax errors. Sometimes the syntax is almost correct, but at runtime, the left hand side expression evaluates to a value instead of a reference, so the assignment is sti... | [
-0.4596679210662842,
0.30224576592445374,
-1.6721956729888916,
0.6919644474983215,
-0.10621070116758347,
-0.7949920892715454,
1.6957461833953857,
1.6963969469070435,
-0.516342282295227,
-0.03860463201999664,
-0.19947406649589539,
-0.2022922784090042,
0.21346241235733032,
0.1219121888279914... |
javascript/reference/errors/invalid_assignment_left-hand_side/index.md | JavaScript - Errors - Invalid assignment left-hand side - Examples - Using optional chaining as assignment target:
Optional chaining is not a valid target of assignment.
Example:
obj?.foo = 1; // SyntaxError: invalid assignment left-hand side
Instead, you have to first guard the nullish case.
Example:
if (obj) {
... | [
-0.5958415865898132,
0.8245242834091187,
-1.159156084060669,
0.012777051888406277,
-0.7644610404968262,
-1.5657953023910522,
1.6443666219711304,
1.2553402185440063,
-0.8328081369400024,
0.6887266635894775,
-0.14282198250293732,
-1.2226823568344116,
0.15845134854316711,
-0.18131890892982483... |
javascript/reference/errors/regex_invalid_char_in_class/index.md | JavaScript - Errors - Regex invalid char in class:
The JavaScript exception "invalid character in class in regular expression" occurs when a character appears in a `v`-mode character class but it's not allowed to appear literally. | [
-0.30080297589302063,
-0.3054672181606293,
-0.15206852555274963,
-0.2625279128551483,
0.3344813287258148,
-0.5178383588790894,
0.5748153924942017,
0.926170825958252,
-0.22424213588237762,
-0.8547257781028748,
-0.4123874306678772,
-1.289305567741394,
-0.12242476642131805,
-0.665345132350921... |
javascript/reference/errors/regex_invalid_char_in_class/index.md | JavaScript - Errors - Regex invalid char in class - Message:
Example:
SyntaxError: Invalid regular expression: /[|]/v: Invalid character in character class (V8-based)
SyntaxError: invalid character in class in regular expression (Firefox)
SyntaxError: Invalid regular expression: invalid class set character (Safari) | [
-0.6676017045974731,
0.3901022672653198,
-0.0755186676979065,
-0.7633691430091858,
0.3807908892631531,
-1.0880767107009888,
0.7654157876968384,
1.101967215538025,
0.12408170104026794,
-0.52972012758255,
0.20179544389247894,
-1.0473365783691406,
0.1331138014793396,
-1.0139176845550537,
-0... |
javascript/reference/errors/regex_invalid_char_in_class/index.md | JavaScript - Errors - Regex invalid char in class - Error type:
`SyntaxError` | [
-0.4702211618423462,
0.7246919870376587,
0.5200005173683167,
-0.9122716784477234,
-0.43054118752479553,
-0.7034376859664917,
0.7203819155693054,
1.636300802230835,
-0.5060333609580994,
-1.2483397722244263,
0.34298214316368103,
-0.8917215466499329,
-0.08468644320964813,
-0.3579660654067993,... |
javascript/reference/errors/regex_invalid_char_in_class/index.md | JavaScript - Errors - Regex invalid char in class - What went wrong?:
Normally, character classes can contain almost all characters literally. However, the `v` mode made the character class syntax more sophisticated, and in order to leave room for future syntax extensions, some syntax characters are forbidden from app... | [
-1.2632578611373901,
-0.16967275738716125,
0.22167153656482697,
-0.6500580310821533,
0.7585439085960388,
-1.7302792072296143,
0.7431919574737549,
1.212401270866394,
0.8198315501213074,
-0.6488298177719116,
0.22319504618644714,
-0.342419296503067,
-0.09271807223558426,
-0.7801507115364075,
... |
javascript/reference/errors/regex_invalid_char_in_class/index.md | JavaScript - Errors - Regex invalid char in class - Examples - Invalid cases:
Example:
/[(){}]/v; | [
-0.2515946924686432,
0.3275876045227051,
-0.4621422588825226,
-0.339727520942688,
0.10173450410366058,
-0.38525816798210144,
0.9592746496200562,
1.3939441442489624,
-0.6826370358467102,
-0.6832510232925415,
0.07671605795621872,
-1.081407904624939,
0.034284334629774094,
-0.47528088092803955... |
javascript/reference/errors/regex_invalid_char_in_class/index.md | JavaScript - Errors - Regex invalid char in class - Examples - Valid cases:
Example:
/[\(\)\\{\\}]/v; | [
-0.20618648827075958,
0.43643662333488464,
-0.33203768730163574,
-0.22241710126399994,
0.03926827386021614,
-0.2987408936023712,
0.5261565446853638,
1.3035026788711548,
-0.6485058665275574,
-0.6595239043235779,
0.20048575103282928,
-1.1494064331054688,
-0.1564866304397583,
-0.5437556505203... |
javascript/reference/errors/bad_radix/index.md | JavaScript - Errors - Bad radix:
The JavaScript exception "radix must be an integer at least 2 and no greater than 36" occurs when the optional `radix` parameter of the `Number.prototype.toString()` or the `BigInt.prototype.toString()` method was specified and is not between 2 and 36. | [
-0.7904684543609619,
-0.6583884954452515,
-0.3623838424682617,
-0.4951600730419159,
-0.8330837488174438,
-1.0377249717712402,
-0.18890301883220673,
0.055135633796453476,
-0.9333887696266174,
-0.5827484130859375,
-0.8152121305465698,
-0.34007692337036133,
-0.5556789636611938,
-1.03399574756... |
javascript/reference/errors/bad_radix/index.md | JavaScript - Errors - Bad radix - Message:
Example:
RangeError: toString() radix argument must be between 2 and 36 (V8-based & Safari)
RangeError: radix must be an integer at least 2 and no greater than 36 (Firefox) | [
-1.4166581630706787,
-0.040429286658763885,
-0.5757911801338196,
-0.7080287933349609,
-0.7642572522163391,
-0.78004390001297,
-0.3153761327266693,
0.35495033860206604,
-0.9271081686019897,
-0.66986083984375,
-0.3315511643886566,
-0.11002025753259659,
-0.7622222900390625,
-0.904853343963623... |
javascript/reference/errors/bad_radix/index.md | JavaScript - Errors - Bad radix - Error type:
`RangeError` | [
-0.47895652055740356,
0.5147532224655151,
-1.4880447387695312,
-0.7478800415992737,
-0.8604762554168701,
-0.15710434317588806,
1.218133568763733,
2.3698630332946777,
-0.8290114998817444,
-0.6782866716384888,
-0.031253132969141006,
-0.4205113649368286,
-0.9431869387626648,
-0.32330548763275... |
javascript/reference/errors/bad_radix/index.md | JavaScript - Errors - Bad radix - What went wrong?:
The optional `radix` parameter of the `Number.prototype.toString()` or the `BigInt.prototype.toString()` method was specified. Its value must be an integer (a number) between 2 and 36, specifying the base of the number system to be used for representing numeric value... | [
-0.24373091757297516,
-0.2457423359155655,
-0.776070237159729,
-0.6471555829048157,
-0.2818017899990082,
-1.8353577852249146,
0.7351029515266418,
0.1621430218219757,
0.07957887649536133,
-0.26052752137184143,
-0.9196041226387024,
0.7064751386642456,
-0.5141385793685913,
-0.2784915566444397... |
javascript/reference/errors/bad_radix/index.md | JavaScript - Errors - Bad radix - Examples - Invalid cases:
Example:
(42).toString(0);
(42).toString(1);
(42).toString(37);
(42).toString(150);
// You cannot use a string like this for formatting:
(12071989).toString("MM-dd-yyyy"); | [
-1.720078706741333,
1.1275721788406372,
-0.3879407048225403,
-0.10847500711679459,
-0.2709243893623352,
-1.3892461061477661,
0.3670766353607178,
0.9358112812042236,
-0.6557363271713257,
-0.35987937450408936,
-0.1786346286535263,
0.36901795864105225,
-0.8280491232872009,
-0.3443873822689056... |
javascript/reference/errors/bad_radix/index.md | JavaScript - Errors - Bad radix - Examples - Valid cases:
Example:
(42).toString(2); // "101010" (binary)
(13).toString(8); // "15" (octal)
(0x42).toString(10); // "66" (decimal)
(100000).toString(16); // "186a0" (hexadecimal) | [
-1.174039602279663,
0.716303288936615,
-0.6477615237236023,
-1.0973726511001587,
-0.6699121594429016,
-1.2648473978042603,
0.7416999340057373,
0.6058037281036377,
-0.5032936930656433,
-0.11535272002220154,
-0.5015324354171753,
0.059750135987997055,
-0.5255462527275085,
-0.31382763385772705... |
javascript/reference/errors/cant_assign_to_property/index.md | JavaScript - Errors - Cant assign to property:
The JavaScript strict mode exception "can't assign to property" occurs when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean. Primitive values cannot hold any property. | [
-0.5498217344284058,
0.4573011100292206,
-0.5813485980033875,
0.7000969648361206,
-0.5094946622848511,
-1.281177043914795,
1.0343303680419922,
1.0199145078659058,
0.06593982130289078,
-1.134935975074768,
-0.869533360004425,
-0.4568917751312256,
-0.6482129693031311,
-0.5968008637428284,
0... |
javascript/reference/errors/cant_assign_to_property/index.md | JavaScript - Errors - Cant assign to property - Message:
Example:
TypeError: Cannot create property 'x' on number '1' (V8-based)
TypeError: can't assign to property "x" on 1: not an object (Firefox)
TypeError: Attempted to assign to readonly property. (Safari) | [
-0.8587270379066467,
0.9105895757675171,
-0.8617077469825745,
0.04250726103782654,
-0.6161808967590332,
-0.9482606649398804,
0.7493481040000916,
1.4397525787353516,
0.1449434608221054,
-1.0413694381713867,
0.09655450284481049,
-0.7434239983558655,
-0.2949935793876648,
-0.8657947778701782,
... |
javascript/reference/errors/cant_assign_to_property/index.md | JavaScript - Errors - Cant assign to property - Error type:
`TypeError`. | [
-0.41002601385116577,
0.6263192892074585,
-0.6061726808547974,
-0.028956279158592224,
-0.5195369720458984,
-0.20724926888942719,
0.6961721181869507,
2.1779046058654785,
-0.07967474311590195,
-1.4380728006362915,
0.5140529870986938,
0.012913595885038376,
-0.35478129982948303,
-0.38838431239... |
javascript/reference/errors/cant_assign_to_property/index.md | JavaScript - Errors - Cant assign to property - What went wrong?:
In strict mode, a `TypeError` is raised when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean. Primitive values cannot hold any property.
The problem might be that an unexpected value is flowing at an... | [
-0.8628025650978088,
0.2447419911623001,
-0.5793763995170593,
0.3723520338535309,
-0.05553511902689934,
-0.9019700884819031,
0.7506612539291382,
1.728088617324829,
0.4302380681037903,
-0.7879148125648499,
-0.6522848010063171,
-0.6122491359710693,
-0.46230146288871765,
-0.8830751180648804,
... |
javascript/reference/errors/cant_assign_to_property/index.md | JavaScript - Errors - Cant assign to property - Examples - Invalid cases:
Example:
"use strict";
const foo = "my string";
// The following line does nothing if not in strict mode.
foo.bar = {}; // TypeError: can't assign to property "bar" on "my string": not an object | [
-0.13594286143779755,
0.4431414306163788,
-1.1988487243652344,
0.42910903692245483,
-0.26035258173942566,
-1.618471622467041,
0.19183041155338287,
1.039628505706787,
0.20739224553108215,
-0.34190186858177185,
-0.4349209666252136,
-0.46881550550460815,
-0.7786261439323425,
-0.43805503845214... |
javascript/reference/errors/cant_assign_to_property/index.md | JavaScript - Errors - Cant assign to property - Examples - Fixing the issue:
Either fix the code to prevent the primitive from being used in such places, or fix the issue by creating the object equivalent `Object`.
Example:
"use strict";
const foo = new String("my string");
foo.bar = {}; | [
0.11947471648454666,
0.1648782640695572,
-0.6791978478431702,
-0.008835273794829845,
-0.20362621545791626,
-1.7820502519607544,
1.2550759315490723,
0.7335107326507568,
-0.012681293301284313,
0.15016832947731018,
-0.8317006826400757,
-0.38430076837539673,
-0.8198240399360657,
-0.04078400880... |
javascript/reference/errors/rest_with_default/index.md | JavaScript - Errors - Rest with default:
The JavaScript exception "rest parameter may not have a default" occurs when a rest parameter has a default value. Because the rest parameter always creates an array, the default value would never apply. | [
-0.08543024957180023,
0.3390156924724579,
-2.2029151916503906,
0.7826260328292847,
-0.8861525058746338,
-1.1257034540176392,
0.17441268265247345,
1.5265414714813232,
-0.01907714270055294,
-0.845746636390686,
-0.7068174481391907,
-0.1734910011291504,
-0.6506581902503967,
-0.2280498147010803... |
javascript/reference/errors/rest_with_default/index.md | JavaScript - Errors - Rest with default - Message:
Example:
SyntaxError: Rest parameter may not have a default initializer (V8-based)
SyntaxError: rest parameter may not have a default (Firefox)
SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (Safari) | [
-0.49765995144844055,
0.41912025213241577,
-1.7359051704406738,
0.19349797070026398,
-1.380028247833252,
-1.251880168914795,
0.49951454997062683,
1.324040412902832,
-0.11621743440628052,
-0.8120881915092468,
0.25942903757095337,
0.10830441862344742,
-0.4802176058292389,
-0.1690060645341873... |
javascript/reference/errors/rest_with_default/index.md | JavaScript - Errors - Rest with default - Error type:
`SyntaxError` | [
-0.21921320259571075,
0.2963908910751343,
-0.9604437351226807,
-0.32780253887176514,
-0.9438447952270508,
-0.7509247660636902,
1.2450430393218994,
2.129718542098999,
0.04135541617870331,
-1.1304306983947754,
0.10823101550340652,
0.5552384853363037,
-0.3229447901248932,
0.11504839360713959,... |
javascript/reference/errors/rest_with_default/index.md | JavaScript - Errors - Rest with default - What went wrong?:
A default parameter gives a parameter a default value if the argument is not passed or passed as `undefined`. A rest parameter collects all the remaining arguments passed to the function and always creates an array. Therefore, it doesn't make sense to have a ... | [
-0.21616122126579285,
0.06985047459602356,
-2.598632335662842,
0.7707552909851074,
-0.5706190466880798,
-1.0477315187454224,
0.9820253252983093,
0.783543586730957,
-0.16270436346530914,
-0.5639057755470276,
-0.5649296045303345,
0.10758110880851746,
-0.3885629177093506,
0.5491717457771301,
... |
javascript/reference/errors/rest_with_default/index.md | JavaScript - Errors - Rest with default - Examples - Invalid cases:
Example:
function doSomething(...args = []) {} | [
0.042839523404836655,
0.37373024225234985,
-1.0986469984054565,
0.05126657709479332,
-0.7211164236068726,
-1.0497359037399292,
0.9735884070396423,
1.1591311693191528,
-1.2204179763793945,
-0.5810776948928833,
-0.18281307816505432,
0.11832694709300995,
-0.2199254184961319,
-0.50065928697586... |
javascript/reference/errors/rest_with_default/index.md | JavaScript - Errors - Rest with default - Examples - Valid cases:
Example:
function doSomething(...args) {
// args is always an array
} | [
-0.16318683326244354,
0.42342907190322876,
-1.1081756353378296,
0.6659608483314514,
-0.6631669402122498,
-0.9576995968818665,
1.0326474905014038,
1.2809338569641113,
-0.9857019186019897,
-0.3708675801753998,
-0.23451583087444305,
0.16723529994487762,
-0.44868069887161255,
-0.04627650976181... |
javascript/reference/errors/bad_optional_template/index.md | JavaScript - Errors - Bad optional template:
The JavaScript exception "tagged template cannot be used with optional chain" occurs when the tag expression of a tagged template literal is an optional chain, or if there's an optional chain between the tag and the template. | [
-0.19888350367546082,
-0.1673659235239029,
-0.09298626333475113,
0.52167147397995,
-0.3708938956260681,
-1.4826363325119019,
0.14727962017059326,
1.0413036346435547,
-1.255777359008789,
0.21951939165592194,
-0.30150794982910156,
-0.14952866733074188,
0.08080536872148514,
-0.304581046104431... |
javascript/reference/errors/bad_optional_template/index.md | JavaScript - Errors - Bad optional template - Message:
Example:
SyntaxError: Invalid tagged template on optional chain (V8-based)
SyntaxError: tagged template cannot be used with optional chain (Firefox)
SyntaxError: Cannot use tagged templates in an optional chain. (Safari) | [
-0.21791896224021912,
0.16308726370334625,
-0.36977431178092957,
0.09509242326021194,
-0.22189809381961823,
-1.7940653562545776,
0.827633798122406,
1.4646055698394775,
-1.1014528274536133,
0.24798719584941864,
0.363119512796402,
-0.07948171347379684,
0.09506768733263016,
-0.216491177678108... |
javascript/reference/errors/bad_optional_template/index.md | JavaScript - Errors - Bad optional template - Error type:
`SyntaxError` | [
-0.48442378640174866,
0.0028899377211928368,
-0.38807275891304016,
-0.3765345513820648,
-0.5083087086677551,
-1.2266757488250732,
1.624780535697937,
1.7881007194519043,
-0.6907414793968201,
-0.3494214117527008,
0.4705280363559723,
-0.44577619433403015,
-0.3730977475643158,
0.15710738301277... |
javascript/reference/errors/bad_optional_template/index.md | JavaScript - Errors - Bad optional template - What went wrong?:
There are two ways to get this error. The first one is if the tag expression is an optional chain expression, like this:
Example:
String?.raw`Hello, world!`;
console.log?.()`Hello, world!`;
Number?.[parseMethod]`Hello, world!`;
The second one is if `?.... | [
0.169479101896286,
0.14701715111732483,
-0.6087149381637573,
1.1877377033233643,
0.5966600179672241,
-0.615818440914154,
0.44562020897865295,
0.8895550966262817,
-0.32029980421066284,
0.08033467829227448,
-0.2698618471622467,
-0.1437210738658905,
0.05865298584103584,
-0.12745265662670135,
... |
javascript/reference/errors/undeclared_var/index.md | JavaScript - Errors - Undeclared var:
The JavaScript strict mode-only exception "Assignment to undeclared variable" occurs when the value has been assigned to an undeclared variable. | [
-0.6075268983840942,
0.028541749343276024,
-1.1346181631088257,
0.9074301719665527,
-1.174736499786377,
-0.5253320336341858,
1.0243468284606934,
0.7512862086296082,
-0.09208640456199646,
-0.30103495717048645,
0.09052854031324387,
-1.1983990669250488,
-0.19862881302833557,
0.079126842319965... |
javascript/reference/errors/undeclared_var/index.md | JavaScript - Errors - Undeclared var - Message:
Example:
ReferenceError: x is not defined (V8-based)
ReferenceError: assignment to undeclared variable x (Firefox)
ReferenceError: Can't find variable: x (Safari) | [
-0.8182875514030457,
0.2981809973716736,
-1.5850213766098022,
0.05504264310002327,
-1.1960957050323486,
-0.47409552335739136,
1.6546522378921509,
0.7228953242301941,
-0.5754878520965576,
-0.6159843802452087,
0.7742235660552979,
-0.7542615532875061,
-0.14902405440807343,
-0.1556424200534820... |
javascript/reference/errors/undeclared_var/index.md | JavaScript - Errors - Undeclared var - Error type:
`ReferenceError` in strict mode only. | [
-0.20792755484580994,
0.2017369270324707,
-1.145896553993225,
0.45488640666007996,
-0.8754414319992065,
0.5550768971443176,
1.4261796474456787,
1.5100595951080322,
-0.3952288329601288,
-0.7518337965011597,
-0.2539685070514679,
-1.067420482635498,
0.09680752456188202,
0.05880771204829216,
... |
javascript/reference/errors/undeclared_var/index.md | JavaScript - Errors - Undeclared var - What went wrong?:
You have an assignment of the form `x = ...`, but `x` has not been previously declared with the `var`, `let`, or `const` keyword. This error occurs in strict mode code only. In non-strict code, assignment to an undeclared variable implicitly creates a property o... | [
-0.7388479113578796,
0.05802854523062706,
-1.1336227655410767,
0.5506131052970886,
-0.5697448253631592,
-0.48084065318107605,
0.44279614090919495,
0.719419538974762,
-0.3596591353416443,
-0.29361462593078613,
0.3142622411251068,
-1.0086013078689575,
-0.3616862893104553,
0.10503604263067245... |
javascript/reference/errors/undeclared_var/index.md | JavaScript - Errors - Undeclared var - Examples - Invalid cases:
In this case, the variable "bar" is an undeclared variable.
Example:
function foo() {
"use strict";
bar = true;
}
foo(); // ReferenceError: assignment to undeclared variable bar | [
-0.2949400246143341,
0.6147435307502747,
-1.5922925472259521,
0.26186397671699524,
-0.4866637885570526,
-1.0016448497772217,
1.1749486923217773,
1.1907674074172974,
-0.7112540006637573,
0.024470053613185883,
-0.22694212198257446,
-0.56632000207901,
0.13946332037448883,
-0.02278044447302818... |
javascript/reference/errors/undeclared_var/index.md | JavaScript - Errors - Undeclared var - Examples - Valid cases:
To make "bar" a declared variable, you can add a `let`, `const`, or `var` keyword in front of it.
Example:
function foo() {
"use strict";
const bar = true;
}
foo(); | [
0.2572842538356781,
-0.039254866540431976,
-1.374579668045044,
0.9173734784126282,
-0.16176718473434448,
-1.0012649297714233,
0.3604015111923218,
1.2722748517990112,
-0.5453343391418457,
0.4255096912384033,
-0.35562077164649963,
-0.44226914644241333,
-0.3320915997028351,
-0.008557897992432... |
javascript/reference/errors/more_arguments_needed/index.md | JavaScript - Errors - More arguments needed:
The JavaScript exception "more arguments needed" occurs when there is an error with how a function is called. More arguments need to be provided. | [
0.15205144882202148,
-0.5577079057693481,
-1.4783031940460205,
0.7522040605545044,
-0.395181804895401,
-1.4265525341033936,
0.0940413847565651,
0.8630165457725525,
-0.9631624221801758,
-0.6203086376190186,
-0.6565965414047241,
-1.551452875137329,
-0.20990394055843353,
0.27352482080459595,
... |
javascript/reference/errors/more_arguments_needed/index.md | JavaScript - Errors - More arguments needed - Message:
Example:
TypeError: Object prototype may only be an Object or null: undefined (V8-based)
TypeError: Object.create requires at least 1 argument, but only 0 were passed (Firefox)
TypeError: Object.setPrototypeOf requires at least 2 arguments, but only 0 were passed... | [
-0.8618793487548828,
-0.6856045126914978,
-0.8706449866294861,
0.2924010157585144,
0.10654548555612564,
-0.8085871934890747,
0.09907729178667068,
0.6407642364501953,
-0.6864864230155945,
-0.2770228981971741,
-0.2096148282289505,
-1.6103413105010986,
0.46492424607276917,
-0.7846487760543823... |
javascript/reference/errors/more_arguments_needed/index.md | JavaScript - Errors - More arguments needed - Error type:
`TypeError`. | [
-0.09586077928543091,
-0.3941061794757843,
-0.7591310143470764,
0.2173895686864853,
-0.004570214077830315,
0.27781909704208374,
0.5740903615951538,
1.687947154045105,
-0.24987126886844635,
-1.0804003477096558,
0.29419222474098206,
-0.8786270618438721,
-0.09695800393819809,
-0.1115715578198... |
javascript/reference/errors/more_arguments_needed/index.md | JavaScript - Errors - More arguments needed - What went wrong?:
There is an error with how a function is called. More arguments need to be provided. | [
0.2237473428249359,
0.025309203192591667,
-1.5686447620391846,
0.0321359746158123,
-0.0027685468085110188,
-1.1828687191009521,
-0.014654831029474735,
1.1139663457870483,
-1.028273582458496,
-0.27491888403892517,
-0.42392289638519287,
-1.442389965057373,
0.0865122377872467,
0.3327431976795... |
javascript/reference/errors/more_arguments_needed/index.md | JavaScript - Errors - More arguments needed - Examples - Required arguments not provided:
The `Object.create()` method requires at least one argument and the `Object.setPrototypeOf()` method requires at least two arguments:
Example:
const obj = Object.create();
// TypeError: Object.create requires at least 1 argumen... | [
-0.43256545066833496,
-0.677391767501831,
-0.7714853286743164,
0.7457214593887329,
0.26534053683280945,
-0.7328162789344788,
-0.3220485746860504,
0.16239742934703827,
-0.6328072547912598,
-0.0845048651099205,
-0.8279135227203369,
-1.0071802139282227,
0.6520689725875854,
-0.5535680651664734... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.