file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/errors/cyclic_object_value/index.md | JavaScript - Errors - Cyclic object value - Message:
Example:
TypeError: Converting circular structure to JSON (V8-based)
TypeError: cyclic object value (Firefox)
TypeError: JSON.stringify cannot serialize cyclic structures. (Safari) | [
-1.1849453449249268,
0.14827802777290344,
-0.863943338394165,
0.16775311529636383,
-0.3263852894306183,
-0.6924247741699219,
0.6841316819190979,
0.5641030669212341,
-0.42054489254951477,
-0.6038780808448792,
0.6066008806228638,
-0.9615007638931274,
0.3339615762233734,
-0.8506770730018616,
... |
javascript/reference/errors/cyclic_object_value/index.md | JavaScript - Errors - Cyclic object value - Error type:
`TypeError` | [
-0.4577614963054657,
-0.4059951603412628,
-1.0760530233383179,
0.060275930911302567,
-0.3010980486869812,
-0.297222375869751,
1.1387933492660522,
1.5372555255889893,
-0.14142470061779022,
-0.8850088119506836,
0.40305617451667786,
-0.7524713277816772,
0.23907440900802612,
-0.302700608968734... |
javascript/reference/errors/cyclic_object_value/index.md | JavaScript - Errors - Cyclic object value - What went wrong?:
The JSON format per se doesn't support object references (although an IETF draft exists), hence `JSON.stringify()` doesn't try to solve them and fails accordingly. | [
-0.8730730414390564,
0.023398566991090775,
-1.1382066011428833,
-0.7446436285972595,
0.2159469723701477,
-1.217209815979004,
0.974109411239624,
0.5723745226860046,
-0.5036592483520508,
-0.39696452021598816,
0.40309303998947144,
-0.6829395890235901,
0.047481194138526917,
-0.492031067609787,... |
javascript/reference/errors/cyclic_object_value/index.md | JavaScript - Errors - Cyclic object value - Examples - Circular references:
In a circular structure like the following:
Example:
const circularReference = { otherData: 123 };
circularReference.myself = circularReference;
`JSON.stringify()` will fail
Example:
JSON.stringify(circularReference);
// TypeError: cyclic... | [
-0.3159034848213196,
-0.05560029298067093,
-1.2082557678222656,
0.7261618971824646,
0.7464035153388977,
-0.3379961848258972,
0.7693465352058411,
0.717172384262085,
0.08643576502799988,
-0.6540824770927429,
-0.12652696669101715,
-0.15096692740917206,
-0.2115180641412735,
0.6074751615524292,... |
javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | JavaScript - Errors - Reduce of empty array with no initial value:
The JavaScript exception "reduce of empty array with no initial value" occurs when a reduce function is used. | [
-0.27723369002342224,
0.26958879828453064,
-0.8610584735870361,
0.8949778079986572,
-0.5138052701950073,
-1.5983998775482178,
2.3041679859161377,
1.667698860168457,
-0.5908260941505432,
0.02968122623860836,
-0.8172492384910583,
-1.9413095712661743,
-0.5706724524497986,
-0.13252440094947815... |
javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | JavaScript - Errors - Reduce of empty array with no initial value - Message:
Example:
TypeError: Reduce of empty array with no initial value (V8-based & Firefox & Safari) | [
-0.5173335075378418,
0.03335091471672058,
-0.7014230489730835,
0.4839240610599518,
-0.7482162117958069,
-0.3825453221797943,
2.589892864227295,
1.6617109775543213,
-0.4226169288158417,
-0.017104342579841614,
-0.2718101143836975,
-1.5823312997817993,
-0.5983008146286011,
-0.5935197472572327... |
javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | JavaScript - Errors - Reduce of empty array with no initial value - Error type:
`TypeError` | [
-0.40317776799201965,
0.01892385259270668,
-0.5580276250839233,
0.11649024486541748,
-0.4111544191837311,
0.08192083984613419,
2.5884456634521484,
2.2108426094055176,
-0.1954466700553894,
-0.2660374045372009,
-0.20478101074695587,
-1.3277100324630737,
-0.11715923249721527,
-0.3362511396408... |
javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | JavaScript - Errors - Reduce of empty array with no initial value - What went wrong?:
In JavaScript, there are several reduce functions:
- `Array.prototype.reduce()`, `Array.prototype.reduceRight()` and
- `TypedArray.prototype.reduce()`, `TypedArray.prototype.reduceRight()`).
These functions optionally take an `init... | [
-0.8878350257873535,
0.19486361742019653,
-0.8495509624481201,
0.6939916610717773,
-0.009646913036704063,
-0.6968538165092468,
2.288088083267212,
0.9383031725883484,
-0.7544628977775574,
0.4603393077850342,
-0.2530306279659271,
-1.1551607847213745,
-0.4632579982280731,
0.055529139935970306... |
javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | JavaScript - Errors - Reduce of empty array with no initial value - Examples - Invalid cases:
This problem appears frequently when combined with a filter (`Array.prototype.filter()`, `TypedArray.prototype.filter()`) which will remove all elements of the list. Thus leaving none to be used as the initial value.
Example... | [
0.2619606852531433,
-0.046094778925180435,
-1.1200063228607178,
1.0105488300323486,
0.35280516743659973,
-1.2621164321899414,
1.571813702583313,
0.8964036107063293,
-0.31850558519363403,
0.6407880783081055,
-0.16733361780643463,
-0.6143088936805725,
-0.8018102645874023,
-0.3126606643199920... |
javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | JavaScript - Errors - Reduce of empty array with no initial value - Examples - Valid cases:
These problems can be solved in two different ways.
One way is to actually provide an `initialValue` as the neutral element of the operator, such as 0 for the addition, 1 for a multiplication, or an empty string for a concaten... | [
0.1407395303249359,
0.23885685205459595,
-0.7168117761611938,
0.9457115530967712,
0.6246662139892578,
0.05294516682624817,
1.2221112251281738,
1.4341379404067993,
-0.39908382296562195,
0.47320556640625,
-0.7484101057052612,
-0.3610444664955139,
-0.5337309241294861,
0.3127491772174835,
-0... |
javascript/reference/errors/regex_invalid_group/index.md | JavaScript - Errors - Regex invalid group:
The JavaScript exception "invalid regexp group" occurs when the sequence `(?` does not start a valid group syntax. Recognized group syntaxes that start with `(?` include:
- `(?:` for non-capturing groups
- `(?=` for positive lookahead
- `(?!` for negative lookahead
- `(?<=` ... | [
-0.21731466054916382,
0.6306111812591553,
-0.4806016683578491,
-0.0033781721722334623,
0.1371363252401352,
-1.302133321762085,
0.8666011691093445,
1.0680586099624634,
-1.103771686553955,
0.1429448127746582,
-0.4315264821052551,
-1.1373027563095093,
-0.6780083775520325,
-0.7660877704620361,... |
javascript/reference/errors/regex_invalid_group/index.md | JavaScript - Errors - Regex invalid group - Message:
Example:
SyntaxError: Invalid regular expression: /(?1)/: Invalid group (V8-based)
SyntaxError: invalid regexp group (Firefox)
SyntaxError: Invalid regular expression: unrecognized character after (? (Safari) | [
-0.358718603849411,
1.0240862369537354,
-0.4528377652168274,
-0.38889744877815247,
0.056604839861392975,
-1.8121058940887451,
0.9568211436271667,
0.8021075129508972,
-0.8355219960212708,
-0.08901464194059372,
-0.05833083391189575,
-0.9530487656593323,
-0.19879500567913055,
-1.0563861131668... |
javascript/reference/errors/regex_invalid_group/index.md | JavaScript - Errors - Regex invalid group - Error type:
`SyntaxError` | [
0.1859441101551056,
0.5553282499313354,
-0.12136261910200119,
-0.5020882487297058,
-0.8130427002906799,
-0.7449864745140076,
1.1820377111434937,
1.860103964805603,
-0.7082268595695496,
-0.674492597579956,
0.021916642785072327,
-0.7286759614944458,
-0.3436325192451477,
-0.38662970066070557,... |
javascript/reference/errors/regex_invalid_group/index.md | JavaScript - Errors - Regex invalid group - What went wrong?:
`?` is not an atom, so it does not make sense to appear at the start of a capturing group (`?` is a quantifier and should be placed after an atom). Maybe you want to match the `?` character literally, in which case you should escape it with a backslash (`\?... | [
0.4636133909225464,
0.25767648220062256,
-0.28732961416244507,
-0.5736741423606873,
0.09766215831041336,
-1.9796020984649658,
0.8242877721786499,
0.8815524578094482,
-0.5924480557441711,
0.017812194302678108,
-0.3777821660041809,
-1.2119938135147095,
-1.0493113994598389,
-0.567120611667633... |
javascript/reference/errors/regex_invalid_group/index.md | JavaScript - Errors - Regex invalid group - Examples - Invalid cases:
Example:
/Hello(?|!)/;
// This is Perl syntax
/(?[\p{Thai}&\p{Digit}])/; | [
-0.9771355390548706,
0.47867271304130554,
-0.1943463832139969,
-0.09683239459991455,
-0.026527872309088707,
-0.34947869181632996,
1.2368463277816772,
1.167459487915039,
-1.04660964012146,
0.40292200446128845,
-0.5117626190185547,
-0.2539338767528534,
0.4780125617980957,
-0.7143239378929138... |
javascript/reference/errors/regex_invalid_group/index.md | JavaScript - Errors - Regex invalid group - Examples - Valid cases:
Example:
/Hello(\?|!)/;
// This is JavaScript syntax for character set operations
/[\p{Thai}&&\p{Digit}]/v; | [
-0.5682591795921326,
-0.09290295839309692,
-0.9996288418769836,
0.3706417679786682,
0.40341371297836304,
-0.3083314001560211,
0.9234670400619507,
1.1478325128555298,
-0.7538124322891235,
0.42384999990463257,
-0.3459966778755188,
-0.4501538574695587,
0.42975857853889465,
-0.9946437478065491... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer:
The JavaScript strict mode-only exception "for-in loop head declarations may not have initializers" occurs when the head of a for...in contains an initializer expression, such as `for (var i = 0 in obj)`. This is not allowed in for-in loops in strict mode. In addition,... | [
-0.008276456035673618,
-0.3582307696342468,
-0.629121720790863,
1.2105696201324463,
-0.5066263675689697,
-0.8815051317214966,
-0.3650541305541992,
1.2152552604675293,
-0.9906063079833984,
-0.19228222966194153,
-0.39727962017059326,
-1.4942785501480103,
0.1368052214384079,
-0.40815240144729... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer - Message:
Example:
SyntaxError: for-in loop variable declaration may not have an initializer. (V8-based)
SyntaxError: for-in loop head declarations may not have initializers (Firefox)
SyntaxError: a lexical declaration in the head of a for-in loop can't have an initia... | [
-0.6309661269187927,
0.1913881152868271,
-0.4354812800884247,
0.5666183233261108,
-0.9608519673347473,
-0.7728652954101562,
-0.14466606080532074,
1.6902190446853638,
-0.8647220134735107,
-0.48001760244369507,
1.0207445621490479,
-1.2933183908462524,
-0.3813239634037018,
-0.1968481689691543... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer - Error type:
`SyntaxError`. | [
0.6700342297554016,
0.20869410037994385,
-0.3397735357284546,
-0.11540696024894714,
-0.7453263401985168,
-0.4968384802341461,
0.7195855975151062,
2.8523378372192383,
-0.47386541962623596,
-0.7492316365242004,
0.6447404623031616,
-0.5614989399909973,
-0.313760906457901,
-0.2795526087284088,... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer - What went wrong?:
The head of a for...in loop contains an initializer expression. That is, a variable is declared and assigned a value `for (var i = 0 in obj)`. In non-strict mode, this head declaration is silently ignored and behaves like `for (var i in obj)`. In str... | [
-0.08935535699129105,
0.29744043946266174,
-0.9505761861801147,
0.9786201119422913,
-0.29713812470436096,
-1.4890681505203247,
-0.2750586271286011,
1.6752898693084717,
-0.7806875705718994,
-0.13754570484161377,
0.2218392938375473,
-1.2382100820541382,
-0.2486560344696045,
0.235987156629562... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer - Examples:
This example throws a `SyntaxError`:
Example:
const obj = { a: 1, b: 2, c: 3 };
for (const i = 0 in obj) {
console.log(obj[i]);
}
// SyntaxError: for-in loop head declarations may not have initializers | [
-0.2933633327484131,
0.5270360112190247,
-1.0192086696624756,
0.33821508288383484,
-0.2432389110326767,
-1.022566795349121,
-0.27805665135383606,
1.6503874063491821,
-0.8900815844535828,
-0.25930601358413696,
0.41394078731536865,
-0.8425126075744629,
0.34176695346832275,
-0.316359877586364... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer - Examples - Valid for-in loop:
You can remove the initializer (`i = 0`) in the head of the for-in loop.
Example:
const obj = { a: 1, b: 2, c: 3 };
for (const i in obj) {
console.log(obj[i]);
} | [
0.39293813705444336,
0.3273771107196808,
-1.0731146335601807,
0.677059531211853,
0.25446459650993347,
-1.0472089052200317,
-0.296471506357193,
0.904242753982544,
-0.9458557367324829,
0.18740859627723694,
-0.23802436888217926,
-1.0162166357040405,
-0.2944899797439575,
-0.4327605366706848,
... |
javascript/reference/errors/invalid_for-in_initializer/index.md | JavaScript - Errors - Invalid for-in initializer - Examples - Array iteration:
The for...in loop shouldn't be used for Array iteration. Did you intend to use a `for` loop instead of a `for-in` loop to iterate an `Array`? The `for` loop allows you to set an initializer then as well:
Example:
const arr = ["a", "b", "c... | [
-0.051597710698843,
0.21318599581718445,
-1.0822153091430664,
1.458604097366333,
-0.10335257649421692,
-0.535063624382019,
-0.44860976934432983,
1.5019758939743042,
-0.7603919506072998,
0.24598531424999237,
0.798611044883728,
-0.49248769879341125,
-0.03062213957309723,
-0.11906775087118149... |
javascript/reference/errors/regex_invalid_decimal_escape/index.md | JavaScript - Errors - Regex invalid decimal escape:
The JavaScript exception "invalid decimal escape in regular expression" occurs when a legacy octal escape sequence is used in a Unicode-aware regular expression pattern. | [
-0.39536815881729126,
0.1535724401473999,
-0.812822699546814,
0.11006630957126617,
-0.24748730659484863,
-0.8794398307800293,
0.9696977138519287,
0.8692300915718079,
-0.8578628301620483,
-0.3356908857822418,
-0.9364437460899353,
-0.8751637935638428,
-0.6067406535148621,
-0.4491360485553741... |
javascript/reference/errors/regex_invalid_decimal_escape/index.md | JavaScript - Errors - Regex invalid decimal escape - Message:
Example:
SyntaxError: Invalid regular expression: /\00/u: Invalid decimal escape (V8-based)
SyntaxError: invalid decimal escape in regular expression (Firefox)
SyntaxError: Invalid regular expression: invalid octal escape for Unicode pattern (Safari) | [
-0.6193824410438538,
0.37901362776756287,
-0.891267716884613,
-0.48802968859672546,
-0.26924341917037964,
-0.8624874949455261,
1.056247353553772,
1.0826150178909302,
-0.6382967829704285,
-0.09982234984636307,
-0.24733130633831024,
-0.814789354801178,
-0.3352230489253998,
-1.096857547760009... |
javascript/reference/errors/regex_invalid_decimal_escape/index.md | JavaScript - Errors - Regex invalid decimal escape - Error type:
`SyntaxError` | [
0.007130809593945742,
0.30790233612060547,
-0.012563973665237427,
-0.6102064847946167,
-0.7342551946640015,
-0.5550813674926758,
1.3200417757034302,
1.8630738258361816,
-0.4845398962497711,
-0.9852754473686218,
0.07636236399412155,
-0.40491899847984314,
-0.8371860384941101,
-0.347715973854... |
javascript/reference/errors/regex_invalid_decimal_escape/index.md | JavaScript - Errors - Regex invalid decimal escape - What went wrong?:
In a regular expression, `\0` followed by another digit is a legacy octal escape sequence. The same syntax is banned in template strings and strict-mode string literals. In regexes, this feature is disabled by the Unicode-aware modes (`u` and `v`).... | [
-0.974494993686676,
0.5361385345458984,
-0.7260446548461914,
-0.4626913368701935,
-0.13451099395751953,
-0.9679581522941589,
0.933698832988739,
1.050715446472168,
-0.4232664704322815,
-0.34633299708366394,
-1.081542730331421,
-0.4120749235153198,
-0.2996794581413269,
-0.44954368472099304,
... |
javascript/reference/errors/regex_invalid_decimal_escape/index.md | JavaScript - Errors - Regex invalid decimal escape - Examples - Invalid cases:
Example:
/\00/u;
/\01/u; | [
-0.07088734209537506,
0.3259311616420746,
-1.0933445692062378,
-0.21996822953224182,
-0.11931788921356201,
-0.38726547360420227,
0.5452328324317932,
1.4382507801055908,
-1.0668247938156128,
0.038147587329149246,
-0.31646955013275146,
-0.7897847890853882,
-0.6329079270362854,
-0.82985693216... |
javascript/reference/errors/regex_invalid_decimal_escape/index.md | JavaScript - Errors - Regex invalid decimal escape - Examples - Valid cases:
Example:
// If you want to match NULL followed by a digit, use a character class
/[\0]0/u;
// If you want to match a character by its character value, use \x
/\x01/u; | [
-0.3179376423358917,
0.17747734487056732,
-0.26189127564430237,
-0.3295634984970093,
0.31387680768966675,
-0.8323365449905396,
1.1455317735671997,
0.3979356288909912,
-0.6393370032310486,
0.006443863734602928,
-0.003651309758424759,
-0.8578872084617615,
-0.47426649928092957,
-0.65733474493... |
javascript/reference/errors/resulting_string_too_large/index.md | JavaScript - Errors - Resulting string too large:
The JavaScript exception "repeat count must be less than infinity" occurs when the `String.prototype.repeat()` method is used with a `count` argument that is infinity. | [
-0.8942002058029175,
0.3315994441509247,
-0.7023386359214783,
-0.07771189510822296,
-0.548165500164032,
-1.6808292865753174,
0.2553877830505371,
0.2628794014453888,
-1.5471429824829102,
-0.2708618640899658,
-1.0701866149902344,
-0.3215813934803009,
-0.2691376507282257,
-0.432082861661911,
... |
javascript/reference/errors/resulting_string_too_large/index.md | JavaScript - Errors - Resulting string too large - Message:
Example:
RangeError: Invalid string length (V8-based)
RangeError: Invalid count value: Infinity (V8-based)
RangeError: repeat count must be less than infinity and not overflow maximum string size (Firefox)
RangeError: Out of memory (Safari)
RangeError: Strin... | [
-1.0639134645462036,
0.307877779006958,
-1.03856360912323,
-0.9496172070503235,
-0.6435379385948181,
-1.6953779458999634,
0.5505756139755249,
-0.00018297611677553505,
-0.8989545702934265,
-0.3875584006309509,
-0.26656609773635864,
0.2339223325252533,
-0.7649996280670166,
-0.379961222410202... |
javascript/reference/errors/resulting_string_too_large/index.md | JavaScript - Errors - Resulting string too large - Error type:
`RangeError` | [
-0.6447146534919739,
0.5686647295951843,
-1.4562623500823975,
-1.1300586462020874,
-0.7789914011955261,
-1.1761634349822998,
0.4517148435115814,
1.7839986085891724,
-1.0985885858535767,
-1.1018433570861816,
0.1899431347846985,
0.4627814292907715,
-1.093233346939087,
-0.14249908924102783,
... |
javascript/reference/errors/resulting_string_too_large/index.md | JavaScript - Errors - Resulting string too large - What went wrong?:
The `String.prototype.repeat()` method has been used. It has a `count` parameter indicating the number of times to repeat the string. It must be between 0 and less than positive `Infinity` and cannot be a negative number. The range of allowed values ... | [
-1.147826910018921,
0.24435479938983917,
-0.6342642307281494,
-0.43217307329177856,
-0.059921637177467346,
-1.2695953845977783,
0.7424181699752808,
0.030561573803424835,
-1.1595696210861206,
-0.22322645783424377,
-0.6193925142288208,
1.0158096551895142,
-0.5930869579315186,
-0.468574315309... |
javascript/reference/errors/resulting_string_too_large/index.md | JavaScript - Errors - Resulting string too large - Examples - Invalid cases:
Example:
"abc".repeat(Infinity); // RangeError
"a".repeat(2 ** 30); // RangeError | [
-1.1694384813308716,
0.7603763937950134,
-0.9826905131340027,
-0.49510759115219116,
-0.47698739171028137,
-1.223443865776062,
0.6702093482017517,
0.9702112078666687,
-1.3991661071777344,
-0.5282397270202637,
-0.2888611853122711,
0.3872607350349426,
-0.3535979390144348,
-0.4267445206642151,... |
javascript/reference/errors/resulting_string_too_large/index.md | JavaScript - Errors - Resulting string too large - Examples - Valid cases:
Example:
"abc".repeat(0); // ''
"abc".repeat(1); // 'abc'
"abc".repeat(2); // 'abcabc'
"abc".repeat(3.5); // 'abcabcabc' (count will be converted to integer) | [
-0.4387967884540558,
0.8518668413162231,
-1.2991143465042114,
-0.5496883392333984,
-0.27352240681648254,
-0.8071126341819763,
0.8443551063537598,
0.8060271143913269,
-1.1626081466674805,
0.07498689740896225,
-0.32340937852859497,
0.1989283263683319,
-0.265317440032959,
0.10524425655603409,... |
javascript/reference/errors/not_a_valid_code_point/index.md | JavaScript - Errors - Not a valid code point:
The JavaScript exception "Invalid code point" occurs when `NaN` values, negative Integers (-1), non-Integers (5.4), or values larger than 0x10FFFF (1114111) are used with `String.fromCodePoint()`. | [
0.19570539891719818,
-0.5691249966621399,
-0.6278252601623535,
-0.26853394508361816,
-0.10520194470882416,
-0.665835440158844,
0.9204506874084473,
-0.09734704345464706,
-1.8777731657028198,
-0.40654438734054565,
-0.9391239285469055,
-1.2779343128204346,
-0.43461862206459045,
-0.96124291419... |
javascript/reference/errors/not_a_valid_code_point/index.md | JavaScript - Errors - Not a valid code point - Message:
Example:
RangeError: Invalid code point -1 (V8-based)
RangeError: -1 is not a valid code point (Firefox)
RangeError: Arguments contain a value that is out of range of code points (Safari) | [
0.4561879336833954,
-0.0676516443490982,
-1.0663957595825195,
-0.6836241483688354,
-0.3417859673500061,
-1.3939505815505981,
1.1758308410644531,
0.9437117576599121,
-0.7091724872589111,
-0.6627588272094727,
0.12324868142604828,
-0.42396944761276245,
-0.8197293877601624,
-0.3235751986503601... |
javascript/reference/errors/not_a_valid_code_point/index.md | JavaScript - Errors - Not a valid code point - Error type:
`RangeError` | [
0.42646461725234985,
0.2904323637485504,
-1.2378109693527222,
-1.0591429471969604,
-0.7456431984901428,
-0.6286294460296631,
0.6918971538543701,
1.5642038583755493,
-0.7158749103546143,
-1.0772093534469604,
0.24422650039196014,
-0.2795237898826599,
-0.8175474405288696,
-0.08771469444036484... |
javascript/reference/errors/not_a_valid_code_point/index.md | JavaScript - Errors - Not a valid code point - What went wrong?:
`String.fromCodePoint()` throws this error when passed `NaN` values, negative Integers (-1), non-Integers (5.4), or values larger than 0x10FFFF (1114111).
A code point is a value in the Unicode codespace; that is, the range of integers from `0` to `0x10... | [
0.01897365413606167,
-0.4881984293460846,
-1.154410481452942,
-0.8863705992698669,
0.21036960184574127,
-0.7442227005958557,
0.5323925018310547,
0.16583813726902008,
-1.3229992389678955,
-0.5635230541229248,
-1.0377446413040161,
-0.7992009520530701,
-0.41334205865859985,
-0.744283199310302... |
javascript/reference/errors/not_a_valid_code_point/index.md | JavaScript - Errors - Not a valid code point - Examples - Invalid cases:
Example:
String.fromCodePoint("_"); // RangeError
String.fromCodePoint(Infinity); // RangeError
String.fromCodePoint(-1); // RangeError
String.fromCodePoint(3.14); // RangeError
String.fromCodePoint(3e-2); // RangeError
String.fromCodePoint(NaN)... | [
-0.15956440567970276,
0.5175909399986267,
-0.6463626623153687,
-0.5678783059120178,
-0.27192044258117676,
-1.2596904039382935,
0.9950734972953796,
1.2905423641204834,
-1.4570523500442505,
-0.5704256296157837,
-0.36790335178375244,
-0.467776894569397,
-0.15486115217208862,
-0.76924896240234... |
javascript/reference/errors/not_a_valid_code_point/index.md | JavaScript - Errors - Not a valid code point - Examples - Valid cases:
Example:
String.fromCodePoint(42); // "*"
String.fromCodePoint(65, 90); // "AZ"
String.fromCodePoint(0x404); // 'Є' (U+0404)
String.fromCodePoint(0x2f804); // '你' (U+2F804)
String.fromCodePoint(194564); // '你'
String.fromCodePoint(0x1d306, 0x61,... | [
-0.17833386361598969,
-0.2142692357301712,
-0.791609525680542,
-1.1127561330795288,
0.15112504363059998,
-1.0272334814071655,
1.028513789176941,
0.2720580995082855,
-0.9514599442481995,
0.19641096889972687,
-0.36737385392189026,
-0.8581352829933167,
-0.27826181054115295,
-0.506853520870208... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const:
The JavaScript exception "missing = in const declaration" occurs when a const declaration was not given a value in the same statement (like `const RED_FLAG;`). You need to provide one (`const RED_FLAG = true`). | [
-0.7078449726104736,
-0.2597821354866028,
-1.2104920148849487,
0.21342618763446808,
-0.3845069706439972,
-0.16298992931842804,
-0.5824533700942993,
1.6920679807662964,
-0.6392585039138794,
0.27585622668266296,
-0.3744392991065979,
-1.5393482446670532,
0.20510436594486237,
-0.01509221177548... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - Message:
Example:
SyntaxError: Missing initializer in const declaration (V8-based)
SyntaxError: missing = in const declaration (Firefox)
SyntaxError: Unexpected token ';'. const declared variable 'x' must have an initializer. (Safari) | [
-0.4160553216934204,
-0.11647438257932663,
-1.4423245191574097,
-0.13673551380634308,
-0.580446720123291,
-0.7052422165870667,
0.20235857367515564,
1.4539872407913208,
-0.37826400995254517,
0.009458179585635662,
0.4764074981212616,
-1.456473469734192,
-0.6267790794372559,
-0.30819451808929... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - Error type:
`SyntaxError` | [
0.09778858721256256,
-0.0733109638094902,
-0.6202083230018616,
-0.46371936798095703,
-0.784026563167572,
0.13363239169120789,
0.300735205411911,
2.181469440460205,
-0.4979858696460724,
-0.4420023560523987,
0.3230864405632019,
-1.1590898036956787,
-0.39208343625068665,
-0.07626576721668243,... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - What went wrong?:
A constant is a value that cannot be altered by the program during normal execution. It cannot change through re-assignment, and it can't be redeclared. In JavaScript, constants are declared using the `const` keyword. An initializer for a constant ... | [
0.3347189724445343,
-0.0673036128282547,
-1.087234377861023,
0.11869586259126663,
0.18959243595600128,
-1.25993013381958,
0.46207982301712036,
1.2534631490707397,
-0.36118459701538086,
0.14541807770729065,
-0.7456951141357422,
-1.2136318683624268,
-0.5556208491325378,
0.18491996824741364,
... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - Examples - Missing const initializer:
Unlike `var` or `let`, you must specify a value for a `const` declaration. This throws:
Example:
const COLUMNS;
// SyntaxError: missing = in const declaration | [
-0.2580195367336273,
0.022981960326433182,
-1.0816102027893066,
0.055349092930555344,
0.13146495819091797,
-0.27972954511642456,
-0.3555159568786621,
1.737658977508545,
-0.7085319757461548,
0.3711239695549011,
0.11046233028173447,
-1.4818432331085205,
-0.46414414048194885,
0.05001858621835... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - Examples - Fixing the error:
There are multiple options to fix this error. Check what was intended to be achieved with the constant in question. | [
0.3610369861125946,
0.2745021879673004,
-0.8596560955047607,
-0.3574361205101013,
-0.40396127104759216,
-0.22334934771060944,
0.1713552474975586,
1.7629790306091309,
-0.49804896116256714,
-0.0702892541885376,
-0.1437896341085434,
-1.2955671548843384,
-0.17348290979862213,
0.244945779442787... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - Examples - Fixing the error - Adding a constant value:
Specify the constant value in the same statement in which it's declared:
Example:
const COLUMNS = 80; | [
0.2195342630147934,
-0.19092300534248352,
-0.8392992615699768,
-0.22149986028671265,
-0.39188483357429504,
-0.2921927571296692,
0.1260002851486206,
1.40228271484375,
-0.7458050847053528,
0.21370986104011536,
-0.14438217878341675,
-0.9700653553009033,
-0.11619140207767487,
0.334130793809890... |
javascript/reference/errors/missing_initializer_in_const/index.md | JavaScript - Errors - Missing initializer in const - Examples - Fixing the error - `const`, `let` or `var`?:
Do not use `const` if you weren't meaning to declare a constant. Maybe you meant to declare a block-scoped variable with `let` or global variable with `var`. Both don't require an initial value.
Example:
let ... | [
-0.1883866935968399,
0.10248740017414093,
-1.5881961584091187,
0.11636265367269516,
-0.08552418649196625,
-0.7458012104034424,
-0.7540773749351501,
1.0742835998535156,
-0.17097847163677216,
-0.055854830890893936,
0.2779945731163025,
-0.6624612808227539,
0.2782931923866272,
0.40425997972488... |
javascript/reference/errors/cant_convert_x_to_bigint/index.md | JavaScript - Errors - Cant convert x to BigInt:
The JavaScript exception "x can't be converted to BigInt" occurs when attempting to convert a `Symbol`, `null`, or `undefined` value to a `BigInt`, or if an operation expecting a BigInt parameter receives a number. | [
-1.0933226346969604,
0.19774538278579712,
-0.8280420899391174,
0.6727606654167175,
-0.5989149808883667,
-1.2633476257324219,
-0.35499945282936096,
0.8196901082992554,
-0.48007065057754517,
-0.8370946645736694,
0.3661316931247711,
-0.9958318471908569,
0.1918347179889679,
-0.2694182693958282... |
javascript/reference/errors/cant_convert_x_to_bigint/index.md | JavaScript - Errors - Cant convert x to BigInt - Message:
Example:
TypeError: Cannot convert null to a BigInt (V8-based)
TypeError: can't convert null to BigInt (Firefox)
TypeError: Invalid argument type in ToBigInt operation (Safari) | [
-1.4944454431533813,
0.1871752291917801,
-0.9658092856407166,
0.19683291018009186,
-0.8605120778083801,
-1.2057673931121826,
-0.12936407327651978,
1.0186833143234253,
-0.030409827828407288,
-0.8158571124076843,
0.564158022403717,
-0.9066748023033142,
0.36072781682014465,
-0.740919291973114... |
javascript/reference/errors/cant_convert_x_to_bigint/index.md | JavaScript - Errors - Cant convert x to BigInt - Error type:
`TypeError`. | [
-0.8884227871894836,
0.1327480673789978,
-0.744127631187439,
-0.7875992655754089,
-0.71104896068573,
0.10195024311542511,
-0.29981622099876404,
1.6241530179977417,
-0.2631368339061737,
-1.457491397857666,
1.10141921043396,
-0.938520610332489,
0.12075528502464294,
-0.41619807481765747,
-0... |
javascript/reference/errors/cant_convert_x_to_bigint/index.md | JavaScript - Errors - Cant convert x to BigInt - What went wrong?:
When using the `BigInt()` function to convert a value to a BigInt, the value would first be converted to a primitive. Then, if it's not one of BigInt, string, number, and boolean, the error is thrown.
Some operations, like `BigInt.asIntN`, require the... | [
-1.286407232284546,
0.5163414478302002,
-0.9577447772026062,
0.35108301043510437,
-0.28857600688934326,
-0.810448408126831,
0.06059017404913902,
0.1923544704914093,
-0.19512277841567993,
-0.8306179642677307,
0.10194452106952667,
-1.1257891654968262,
0.49797576665878296,
-0.2840300500392914... |
javascript/reference/errors/cant_convert_x_to_bigint/index.md | JavaScript - Errors - Cant convert x to BigInt - Examples - Using BigInt() on invalid values:
Example:
const a = BigInt(null);
// TypeError: can't convert null to BigInt
const b = BigInt(undefined);
// TypeError: can't convert undefined to BigInt
const c = BigInt(Symbol("1"));
// TypeError: can't convert Symbol("1") ... | [
-1.0112159252166748,
0.3814249038696289,
-1.312319278717041,
0.19114752113819122,
0.21525023877620697,
-1.1125636100769043,
0.26285773515701294,
0.8702511191368103,
-0.3667392432689667,
-0.4430818557739258,
-0.15343832969665527,
-0.32436588406562805,
0.6366797089576721,
-0.5186712145805359... |
javascript/reference/errors/cant_convert_x_to_bigint/index.md | JavaScript - Errors - Cant convert x to BigInt - Examples - Passing a number to a function expecting a BigInt:
Example:
const a = BigInt.asIntN(4, 8);
// TypeError: can't convert 8 to BigInt
const b = new BigInt64Array(3).fill(3);
// TypeError: can't convert 3 to BigInt
Example:
const a = BigInt.asIntN(4, 8n);
cons... | [
-0.3296843469142914,
0.24301329255104065,
-1.2082040309906006,
-0.11268696933984756,
-0.46899697184562683,
-0.5401754379272461,
-0.7760091423988342,
0.5791357159614563,
-0.5057277083396912,
-0.7776921987533569,
0.30611932277679443,
0.019319606944918633,
0.8045617341995239,
-0.1112680658698... |
javascript/reference/errors/bad_break/index.md | JavaScript - Errors - Bad break:
The JavaScript exception "unlabeled break must be inside loop or switch" occurs when a `break` statement is not inside a loop or a `switch` statement. | [
-0.8945378661155701,
0.6018069982528687,
-1.7587320804595947,
0.4962448477745056,
-0.46119773387908936,
0.2765667140483856,
-0.06861507892608643,
0.7106087803840637,
-0.7407010793685913,
-0.22374776005744934,
-0.39028826355934143,
-1.0525836944580078,
-0.40770086646080017,
-0.0981583818793... |
javascript/reference/errors/bad_break/index.md | JavaScript - Errors - Bad break - Message:
Example:
SyntaxError: Illegal break statement (V8-based)
SyntaxError: unlabeled break must be inside loop or switch (Firefox)
SyntaxError: 'break' is only valid inside a switch or loop statement. (Safari) | [
-0.7804895639419556,
0.7720978260040283,
-1.0889785289764404,
-0.06530853360891342,
-0.521996021270752,
-0.6121824979782104,
0.6357160806655884,
1.0831401348114014,
-0.5460903644561768,
0.033097732812166214,
0.12697428464889526,
-0.7501546740531921,
-0.29291436076164246,
-0.643611192703247... |
javascript/reference/errors/bad_break/index.md | JavaScript - Errors - Bad break - Error type:
`SyntaxError`. | [
0.12525424361228943,
0.29838696122169495,
-0.7329827547073364,
-0.15998958051204681,
-0.5786074995994568,
-0.118199422955513,
1.2822073698043823,
2.348055124282837,
-0.35008832812309265,
-0.6975856423377991,
0.18709279596805573,
-0.6053890585899353,
-0.2546856999397278,
-0.1540343165397644... |
javascript/reference/errors/bad_break/index.md | JavaScript - Errors - Bad break - What went wrong?:
`break` statements can be used to exit a loop or a `switch` statement, and using them elsewhere is a syntax error. Alternatively, you can provide a label to the `break` statement to break out of any statement with that label — however, if the label does not reference... | [
-0.8849853873252869,
0.8280476331710815,
-1.2269368171691895,
0.5889896750450134,
-0.043228548020124435,
-1.3348331451416016,
0.21003738045692444,
1.448097825050354,
0.054108988493680954,
0.06507273018360138,
-0.06412304192781448,
-0.31637272238731384,
-0.8606131672859192,
0.26655071973800... |
javascript/reference/errors/bad_break/index.md | JavaScript - Errors - Bad break - Examples - Unsyntactic break:
`break` cannot be used outside `switch` or loops.
Example:
let score = 0;
function increment() {
if (score === 100)
break; // SyntaxError: unlabeled break must be inside loop or switch
}
score++;
}
Maybe instead of `break`, you intend to use... | [
-1.0881701707839966,
1.0156097412109375,
-0.685123085975647,
0.7575755715370178,
-0.0690106675028801,
-1.021167278289795,
0.593757688999176,
0.8475164771080017,
-0.7954221963882446,
-0.06111442297697067,
0.15606924891471863,
0.35743165016174316,
-0.5747085213661194,
0.30713748931884766,
... |
javascript/reference/errors/bad_break/index.md | JavaScript - Errors - Bad break - Examples - Using break in callbacks:
`break` cannot be used in callbacks, even if the callback is called from a loop.
Example:
let containingIndex = 0;
const matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];
while (containingIndex < matrix.length) {
matrix[containingIndex].for... | [
0.2548312246799469,
0.7941466569900513,
-1.200378656387329,
0.29129934310913086,
-0.36420270800590515,
-0.6383314728736877,
0.5122955441474915,
0.7744930386543274,
-1.0735589265823364,
0.2256786823272705,
-0.485879510641098,
-0.009853909723460674,
0.22418178617954254,
0.2967250347137451,
... |
javascript/reference/errors/cant_convert_bigint_to_number/index.md | JavaScript - Errors - Cant convert BigInt to number:
The JavaScript exception "can't convert BigInt to number" occurs when an arithmetic operation involves a mix of `BigInt` and `Number` values. | [
-0.23625068366527557,
0.008531352505087852,
-0.8571231961250305,
0.04226682707667351,
-0.17305202782154083,
-1.0099915266036987,
-0.4458504319190979,
0.9323195815086365,
-0.6475881338119507,
-0.5906856060028076,
-0.09510182589292526,
-0.5506536960601807,
-0.19511908292770386,
-0.2463773339... |
javascript/reference/errors/cant_convert_bigint_to_number/index.md | JavaScript - Errors - Cant convert BigInt to number - Message:
Example:
TypeError: Cannot convert a BigInt value to a number (V8-based)
TypeError: Cannot mix BigInt and other types, use explicit conversions (V8-based)
TypeError: BigInts have no unsigned right shift, use >> instead (V8-based)
TypeError: can't convert ... | [
-0.9764533042907715,
0.17682720720767975,
-0.6799635291099548,
-0.040346838533878326,
0.45570993423461914,
-0.2671980857849121,
0.5774950385093689,
0.34028854966163635,
-0.09318167716264725,
-0.24081125855445862,
-0.12756556272506714,
0.011854371055960655,
0.4402639865875244,
-0.0492761097... |
javascript/reference/errors/cant_convert_bigint_to_number/index.md | JavaScript - Errors - Cant convert BigInt to number - Error type:
`TypeError`. | [
-0.699503481388092,
0.20452694594860077,
-0.6071009039878845,
-0.8913087844848633,
-0.4024757444858551,
0.0019708096515387297,
-0.10064355283975601,
1.6889173984527588,
-0.6708558201789856,
-1.0323188304901123,
0.7065175771713257,
-0.696936845779419,
-0.1833256036043167,
-0.268687218427658... |
javascript/reference/errors/cant_convert_bigint_to_number/index.md | JavaScript - Errors - Cant convert BigInt to number - What went wrong?:
The two sides of an arithmetic operator must both be BigInts or both not. If an operation involves a mix of BigInts and numbers, it's ambiguous whether the result should be a BigInt or number, since there may be loss of precision in both cases.
T... | [
-1.2270606756210327,
0.039503324776887894,
-1.4320508241653442,
-0.07966925203800201,
-0.026448016986250877,
-0.6462728381156921,
-0.547444224357605,
0.8882429003715515,
-0.01214679703116417,
-0.09723328799009323,
-0.6044113039970398,
-1.0158900022506714,
-0.1875981092453003,
-0.2889195978... |
javascript/reference/errors/cant_convert_bigint_to_number/index.md | JavaScript - Errors - Cant convert BigInt to number - Examples - Mixing numbers and BigInts in operations:
Example:
const sum = 1n + 1;
// TypeError: can't convert BigInt to number
Instead, explicitly coerce one side to a BigInt or number.
Example:
const sum = 1n + BigInt(1);
const sum2 = Number(1n) + 1; | [
0.005626783240586519,
0.5008053779602051,
-1.2321306467056274,
-0.807641863822937,
-0.05679474025964737,
-0.35011014342308044,
-0.6323769688606262,
0.9068703651428223,
-0.6746284365653992,
-0.3488766849040985,
-0.7470211982727051,
-0.3766237199306488,
0.2217286080121994,
-0.730978727340698... |
javascript/reference/errors/cant_convert_bigint_to_number/index.md | JavaScript - Errors - Cant convert BigInt to number - Examples - Using unsigned right shift on BigInts:
Example:
const a = 4n >>> 2n;
// TypeError: can't convert BigInt to number
Use normal right shift instead.
Example:
const a = 4n >> 2n; | [
-0.8791688680648804,
0.7541175484657288,
-0.5640904307365417,
-0.5828110575675964,
-0.5736039876937866,
-0.4369334876537323,
-0.6652182340621948,
0.7375849485397339,
-0.3823454976081848,
-0.40921711921691895,
-0.2922455966472626,
0.3139646351337433,
0.3737472593784332,
-0.41217249631881714... |
javascript/reference/errors/arguments_not_allowed/index.md | JavaScript - Errors - Arguments not allowed:
The JavaScript exception "SyntaxError: arguments is not valid in fields" occurs when the `arguments` identifier is read in a class field initializer or in a static initialization block, outside of a non-arrow function. | [
0.3661017119884491,
0.16643603146076202,
-0.06549964100122452,
0.2188032567501068,
-0.724544882774353,
-2.240893602371216,
0.24372747540473938,
1.2569659948349,
0.003023688215762377,
-0.1762375831604004,
-0.12466387450695038,
-1.1801003217697144,
0.21208864450454712,
0.0899139791727066,
... |
javascript/reference/errors/arguments_not_allowed/index.md | JavaScript - Errors - Arguments not allowed - Message:
Example:
SyntaxError: 'arguments' is not allowed in class field initializer or static initialization block (V8-based)
SyntaxError: arguments is not valid in fields (Firefox)
SyntaxError: Unexpected identifier 'arguments'. Cannot reference 'arguments' in class fie... | [
-0.1866787225008011,
-0.06148257851600647,
-0.09008721262216568,
-0.44389641284942627,
-1.120749592781067,
-2.068854331970215,
0.6108646988868713,
1.2914738655090332,
0.2360294908285141,
-0.18420173227787018,
0.18328368663787842,
-0.8209792971611023,
0.23846152424812317,
-0.144034117460250... |
javascript/reference/errors/arguments_not_allowed/index.md | JavaScript - Errors - Arguments not allowed - Error type:
`SyntaxError` | [
0.5287269353866577,
0.18012215197086334,
-0.1061459481716156,
-0.48297837376594543,
-0.906568169593811,
-1.1255264282226562,
1.4628496170043945,
2.4590723514556885,
0.4720674753189087,
-0.9930922985076904,
0.4308532178401947,
-0.2354961335659027,
0.045950476080179214,
-0.24406814575195312,... |
javascript/reference/errors/arguments_not_allowed/index.md | JavaScript - Errors - Arguments not allowed - What went wrong?:
A class field initializer expression or a class static initialization block does not have `arguments` in its scope. Trying to access it is a syntax error.
- This is true even if `arguments` is bound in a parent scope (such as when the class is nested in ... | [
0.4413975477218628,
0.4175522029399872,
-0.03475159406661987,
-0.38761454820632935,
-0.6751405000686646,
-1.5036475658416748,
0.3624873757362366,
0.8712061047554016,
0.13487179577350616,
0.0024352986365556717,
0.14376913011074066,
-0.86396723985672,
0.3651656210422516,
-0.46597230434417725... |
javascript/reference/errors/arguments_not_allowed/index.md | JavaScript - Errors - Arguments not allowed - Examples:
Example:
function makeOne() {
class C {
args = { ...arguments }; // SyntaxError: arguments is not valid in fields
}
return new C();
}
Example:
let CArgs;
class C {
static {
CArgs = arguments; // SyntaxError: arguments is not valid in fields
}... | [
0.6809857487678528,
0.24766118824481964,
-0.23214474320411682,
0.7501946687698364,
0.08635944128036499,
-3.0201847553253174,
-0.08403261750936508,
1.2477326393127441,
-0.5531721711158752,
0.04275094345211983,
-1.0724289417266846,
-0.6897166967391968,
0.4371569752693176,
-1.2124192714691162... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params:
The JavaScript exception "`"use strict"` not allowed in function" occurs when a `"use strict"` directive is used at the top of a function with `default parameters`, `rest parameters`, or `destructuring parameters`. | [
0.46260780096054077,
-0.20490600168704987,
-1.4455585479736328,
0.5837235450744629,
-0.758141279220581,
-1.7201913595199585,
0.03245169296860695,
0.2840999364852905,
-0.3771172761917114,
-0.12928378582000732,
-0.9753527045249939,
-0.7831965088844299,
0.0012747597647830844,
-0.4114809930324... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params - Message:
Example:
SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (V8-based)
SyntaxError: "use strict" not allowed in function with default parameter (Firefox)
SyntaxError: "use strict" not allowed in function with rest parameter ... | [
-0.4571722149848938,
0.031667355448007584,
-1.185593605041504,
-0.03110961988568306,
-0.9305230379104614,
-1.764224886894226,
0.34950709342956543,
0.3602999448776245,
-0.052885618060827255,
0.35619357228279114,
-0.20188575983047485,
-0.3757488429546356,
0.2746429145336151,
-0.6170579791069... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params - Error type:
`SyntaxError`. | [
-0.6372766494750977,
0.2837943732738495,
-0.32053786516189575,
-0.2238205373287201,
-0.5530350804328918,
-0.4984900951385498,
0.9762599468231201,
2.326474905014038,
-0.46815019845962524,
-0.8605796694755554,
-0.15109410881996155,
-0.5093895792961121,
0.02917194925248623,
-0.143171414732933... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params - What went wrong?:
A `"use strict"` directive is written at the top of a function that has one of the following parameters:
- `Default parameters`
- `Rest parameters`
- `Destructuring parameters`
A `"use strict"` directive is not allowed at the top of such functions pe... | [
-0.449558824300766,
-0.43210065364837646,
-1.366294503211975,
0.06013494357466698,
-0.24934527277946472,
-1.7937599420547485,
0.5736425518989563,
0.5055027008056641,
-0.0543474480509758,
0.09604773670434952,
-0.21862250566482544,
-0.10280098021030426,
0.08970065414905548,
-0.23077398538589... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params - Examples - Function statement:
In this case, the function `sum` has default parameters `a=1` and `b=2`:
Example:
function sum(a = 1, b = 2) {
// SyntaxError: "use strict" not allowed in function with default parameter
"use strict";
return a + b;
}
If the functi... | [
-0.5848059058189392,
-0.09944140911102295,
-1.4709298610687256,
0.13293389976024628,
-0.010109638795256615,
-0.9261991381645203,
0.11722393333911896,
1.1429599523544312,
-0.2231433093547821,
-0.1753014624118805,
-0.7938619256019592,
0.5904064774513245,
0.505350649356842,
-0.362839221954345... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params - Examples - Function expression:
A function expression can use yet another workaround:
Example:
const sum = function sum([a, b]) {
// SyntaxError: "use strict" not allowed in function with destructuring parameter
"use strict";
return a + b;
};
This can be conver... | [
0.82313072681427,
-0.0018309139413759112,
-1.2151881456375122,
0.051565226167440414,
-0.07723072171211243,
-1.259373426437378,
-0.06965713948011398,
0.7668968439102173,
0.3614524304866791,
0.1098523810505867,
-0.7344376444816589,
0.3877438008785248,
0.21572114527225494,
-0.5533570647239685... |
javascript/reference/errors/strict_non_simple_params/index.md | JavaScript - Errors - Strict non simple params - Examples - Arrow function:
If an arrow function needs to access the `this` variable, you can use the arrow function as the enclosing function:
Example:
const callback = (...args) => {
// SyntaxError: "use strict" not allowed in function with rest parameter
"use st... | [
-0.2865622341632843,
0.41086822748184204,
-0.5907284617424011,
0.05810335651040077,
0.002428202424198389,
-1.5603142976760864,
0.7861021757125854,
0.2844165563583374,
-0.05348367616534233,
-0.6296597719192505,
-0.4585123062133789,
-0.6681191921234131,
0.29557955265045166,
0.273214608430862... |
javascript/reference/errors/private_double_initialization/index.md | JavaScript - Errors - Private double initialization:
The JavaScript exception "Initializing an object twice is an error with private fields/methods" occurs when an object that was created via a class constructor goes through the class construction again, and the class contains a private element. This is usually caused... | [
-0.5106568932533264,
-0.5061845183372498,
-0.8533557057380676,
1.307124376296997,
-0.211907759308815,
-0.30424270033836365,
0.9933173656463623,
0.539617657661438,
-1.155510663986206,
-0.31103625893592834,
-0.8051528334617615,
-0.8076871633529663,
-0.2821810841560364,
-0.5944384336471558,
... |
javascript/reference/errors/private_double_initialization/index.md | JavaScript - Errors - Private double initialization - Message:
Example:
TypeError: Cannot initialize #x twice on the same object (V8-based)
TypeError: Initializing an object twice is an error with private fields (Firefox)
TypeError: Cannot redefine existing private field (evaluating 'super(o)') (Safari)
TypeError: C... | [
-0.7184044718742371,
-0.3378034830093384,
-1.0235216617584229,
0.20586040616035461,
-0.6231384873390198,
0.03619954362511635,
1.861003041267395,
0.765678346157074,
-0.9578453302383423,
-0.29053598642349243,
0.08966192603111267,
-0.8980018496513367,
0.38453683257102966,
-0.8228184580802917,... |
javascript/reference/errors/private_double_initialization/index.md | JavaScript - Errors - Private double initialization - Error type:
`TypeError` | [
-0.44248145818710327,
-0.120195172727108,
-1.1124372482299805,
0.10205143690109253,
-0.8989154100418091,
1.1352819204330444,
1.856240153312683,
1.985813856124878,
-0.1349167376756668,
-0.46315157413482666,
0.1784282624721527,
-0.9491406083106995,
-0.010030727833509445,
-0.9146684408187866,... |
javascript/reference/errors/private_double_initialization/index.md | JavaScript - Errors - Private double initialization - What went wrong?:
For any object, if it already contains a private field or method, it would be an error to install the same field again. Private elements are installed on the value of `this` when the class constructor is called, so this error could happen if the `... | [
0.31008467078208923,
-0.1250925362110138,
-0.8506710529327393,
0.7757006883621216,
0.47698259353637695,
-0.14784842729568481,
0.6720719933509827,
1.3781925439834595,
-0.17158620059490204,
-0.38879716396331787,
-0.3174380660057068,
0.16867172718048096,
-0.45718061923980713,
-0.0489217229187... |
javascript/reference/errors/missing_parenthesis_after_condition/index.md | JavaScript - Errors - Missing parenthesis after condition:
The JavaScript exception "missing ) after condition" occurs when there is an error with how an `if` condition is written. It must appear in parenthesis after the `if` keyword. | [
-0.4326024651527405,
-0.6617767214775085,
-0.6965236663818359,
0.045747581869363785,
0.18342278897762299,
-1.1459484100341797,
1.155627965927124,
1.2521182298660278,
-1.1250267028808594,
0.24629628658294678,
-0.39942607283592224,
-1.046698808670044,
-1.1071206331253052,
0.2519575357437134,... |
javascript/reference/errors/missing_parenthesis_after_condition/index.md | JavaScript - Errors - Missing parenthesis after condition - Message:
Example:
SyntaxError: missing ) after condition (Firefox)
SyntaxError: Unexpected token '{'. Expected ')' to end an 'if' condition. (Safari) | [
-0.8647100329399109,
-0.06526772677898407,
-0.7730575799942017,
-0.5767406821250916,
-0.4593871831893921,
-1.268727421760559,
1.400516390800476,
1.6321816444396973,
-0.5831048488616943,
-0.1886603832244873,
0.937745213508606,
-0.07638181746006012,
-0.39605697989463806,
-0.14218653738498688... |
javascript/reference/errors/missing_parenthesis_after_condition/index.md | JavaScript - Errors - Missing parenthesis after condition - Error type:
`SyntaxError` | [
-0.41346848011016846,
-0.11271486431360245,
-0.3931368291378021,
-0.5797361135482788,
-0.5117189884185791,
-0.6594968438148499,
1.3615868091583252,
2.265545129776001,
-0.45857366919517517,
-1.05643892288208,
0.7256598472595215,
-0.5520653128623962,
-0.6950708627700806,
0.014024072326719761... |
javascript/reference/errors/missing_parenthesis_after_condition/index.md | JavaScript - Errors - Missing parenthesis after condition - What went wrong?:
There is an error with how an `if` condition is written. In any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs. The if statement executes a statement if a specified conditio... | [
-0.15246142446994781,
-0.4816858172416687,
-0.620305061340332,
-0.3957729935646057,
0.13749472796916962,
-1.223229169845581,
1.2637602090835571,
1.4394352436065674,
-0.9803085923194885,
0.15747153759002686,
-0.39415839314460754,
-0.9290398955345154,
-0.9064212441444397,
-0.4102684259414673... |
javascript/reference/errors/missing_parenthesis_after_condition/index.md | JavaScript - Errors - Missing parenthesis after condition - Examples - Missing parenthesis:
It might just be an oversight, carefully check all you parenthesis in your code.
Example:
if (Math.PI < 3 {
console.log("wait what?");
}
// SyntaxError: missing ) after condition
To fix this code, you would need to add a ... | [
-0.7325148582458496,
-0.5172882080078125,
-0.9315369725227356,
-0.5707959532737732,
0.11644772440195084,
-1.4835937023162842,
0.9854221343994141,
1.9714970588684082,
-0.5499526858329773,
0.16663087904453278,
0.1713913083076477,
-0.18362803757190704,
-0.3247682452201843,
0.2310548573732376,... |
javascript/reference/errors/missing_parenthesis_after_condition/index.md | JavaScript - Errors - Missing parenthesis after condition - Examples - Misused is keyword:
If you are coming from another programming language, it is also easy to add keywords that don't mean the same or have no meaning at all in JavaScript.
Example:
if (done is true) {
console.log("we are done!");
}
// SyntaxErro... | [
0.28042346239089966,
-0.29367709159851074,
-0.5851345658302307,
-0.04613811895251274,
0.24569377303123474,
-1.1724861860275269,
1.699916958808899,
1.4561179876327515,
-0.7610589265823364,
0.207718625664711,
-0.37589317560195923,
-0.4483281672000885,
-1.0527197122573853,
-0.1614105105400085... |
javascript/reference/errors/promise_any_all_rejected/index.md | JavaScript - Errors - Promise any all rejected:
The JavaScript exception "No Promise in Promise.any was resolved" occurs when all promises passed to `Promise.any()` are rejected. It is the only built-in usage of `AggregateError`. | [
-0.3100496828556061,
0.6878736615180969,
-0.5103716254234314,
-0.33925580978393555,
-0.8789780139923096,
-1.0311130285263062,
1.00123929977417,
0.5465220212936401,
-1.2118602991104126,
-0.42389950156211853,
-0.5149457454681396,
-1.0225037336349487,
-0.6086651682853699,
0.6087672710418701,
... |
javascript/reference/errors/promise_any_all_rejected/index.md | JavaScript - Errors - Promise any all rejected - Message:
Example:
AggregateError: All promises were rejected (V8-based)
AggregateError: No Promise in Promise.any was resolved (Firefox)
AggregateError (Safari) | [
-0.770239531993866,
0.3536871671676636,
-0.5708465576171875,
-1.1319358348846436,
-1.1702165603637695,
-1.5478795766830444,
0.9794721603393555,
0.6326606869697571,
-1.3585611581802368,
-0.3794529139995575,
-0.0665888786315918,
-0.8794319033622742,
-0.6552770137786865,
0.6051933765411377,
... |
javascript/reference/errors/promise_any_all_rejected/index.md | JavaScript - Errors - Promise any all rejected - Error type:
`AggregateError` | [
-0.5322178602218628,
-0.17515073716640472,
-0.7703722715377808,
-0.32646024227142334,
-1.054533839225769,
-0.5842731595039368,
1.5593886375427246,
0.8997764587402344,
-1.3457319736480713,
-0.540000855922699,
-0.28760331869125366,
-0.38324683904647827,
-0.4115902781486511,
0.400007992982864... |
javascript/reference/errors/promise_any_all_rejected/index.md | JavaScript - Errors - Promise any all rejected - What went wrong?:
`Promise.any()` only rejects when all promises passed to it are rejected. You should access `errors` to get the array of rejection reasons. See Using promises for more information on how to handle asynchronously rejected promises. This error is also ra... | [
-1.3136355876922607,
1.1831611394882202,
0.0918780043721199,
-0.5865254998207092,
-0.5396823287010193,
-1.3421565294265747,
0.2538941204547882,
1.1913985013961792,
-1.0339797735214233,
-0.0035828212276101112,
-0.6085388660430908,
-0.5857350826263428,
-0.7326608300209045,
0.6702709794044495... |
javascript/reference/errors/promise_any_all_rejected/index.md | JavaScript - Errors - Promise any all rejected - Examples - Empty iterable:
Example:
Promise.any([]).catch((error) => {
console.error(error); // AggregateError: No Promise in Promise.any was resolved
}); | [
-0.5878450870513916,
0.686754584312439,
-0.20654718577861786,
-0.9242032170295715,
-0.6220239996910095,
-1.3152387142181396,
1.1795393228530884,
1.1832040548324585,
-1.5927573442459106,
-0.4066113233566284,
0.22417975962162018,
-0.9632304310798645,
-0.6516501307487488,
0.44429928064346313,... |
javascript/reference/errors/promise_any_all_rejected/index.md | JavaScript - Errors - Promise any all rejected - Examples - Handling all rejections:
Example:
const promises = [
fetch("/data-location1"),
fetch("/data-location1"),
fetch("/data-location1"),
];
Promise.any(promises)
.then((value) => console.log(value))
.catch((error) => {
// None of the fetches were su... | [
0.2779075801372528,
-0.10298532247543335,
-0.7087088227272034,
0.3186308443546295,
-0.6675033569335938,
-0.7303377985954285,
0.7672313451766968,
0.6414515376091003,
-0.6622238159179688,
0.2056930810213089,
-0.4398663640022278,
-0.21187126636505127,
-0.5323308706283569,
0.5354535579681396,
... |
javascript/reference/errors/invalid_right_hand_side_instanceof_operand/index.md | JavaScript - Errors - invalid right hand side instanceof operand:
The JavaScript exception "invalid 'instanceof' operand" occurs when the right-hand side operands of the `instanceof` operator isn't used with a constructor object, i.e., an object which has a `prototype` property and is callable. | [
-0.4400259852409363,
-0.2640160322189331,
-0.24454538524150848,
0.5941353440284729,
-0.25515806674957275,
-0.19852979481220245,
-0.04533764347434044,
1.1934834718704224,
0.07989618182182312,
0.0014085712609812617,
-1.1150954961776733,
-1.6021515130996704,
0.6078891754150391,
-0.41940963268... |
javascript/reference/errors/invalid_right_hand_side_instanceof_operand/index.md | JavaScript - Errors - invalid right hand side instanceof operand - Message:
Example:
TypeError: Right-hand side of 'instanceof' is not an object (V8-based)
TypeError: invalid 'instanceof' operand "x" (Firefox)
TypeError: Right hand side of instanceof is not an object (Safari)
TypeError: Right-hand side of 'instanceo... | [
-0.10512285679578781,
0.022308971732854843,
-0.8513346910476685,
-0.2668555974960327,
-0.7005926966667175,
-0.5119431018829346,
0.5851437449455261,
1.2416982650756836,
0.6398759484291077,
0.223866805434227,
-0.1940145343542099,
-1.1649104356765747,
0.3543519675731659,
-0.1072869673371315,
... |
javascript/reference/errors/invalid_right_hand_side_instanceof_operand/index.md | JavaScript - Errors - invalid right hand side instanceof operand - Error type:
`TypeError` | [
-0.12130779772996902,
0.08960691094398499,
-0.6905195713043213,
-0.18650047481060028,
-0.5292458534240723,
0.47048312425613403,
0.8707537651062012,
2.197305679321289,
-0.008345922455191612,
-0.0861632227897644,
-0.4350290894508362,
-1.4289907217025757,
0.4524981379508972,
-0.53296226263046... |
javascript/reference/errors/invalid_right_hand_side_instanceof_operand/index.md | JavaScript - Errors - invalid right hand side instanceof operand - What went wrong?:
The `instanceof` operator expects the right-hand-side operands to be a constructor object, i.e., an object which has a `prototype` property and is callable. It can also be an object with a `Symbol.hasInstance` method. This error can o... | [
-0.5667672157287598,
-0.04510349780321121,
-0.6809967756271362,
0.32422327995300293,
-0.14464081823825836,
-0.35448500514030457,
-0.45733022689819336,
1.8210511207580566,
0.45326629281044006,
0.258320689201355,
-1.3418552875518799,
-1.114039659500122,
0.7396327257156372,
-0.552833914756774... |
javascript/reference/errors/invalid_right_hand_side_instanceof_operand/index.md | JavaScript - Errors - invalid right hand side instanceof operand - Examples - instanceof vs. typeof:
Example:
"test" instanceof ""; // TypeError: invalid 'instanceof' operand ""
42 instanceof 0; // TypeError: invalid 'instanceof' operand 0
function Foo() {}
const f = Foo(); // Foo() is called and returns undefined
c... | [
0.24437488615512848,
-0.42835888266563416,
-0.4322568476200104,
-0.11971267312765121,
-0.07625984400510788,
-0.30864816904067993,
0.5483762621879578,
1.492576003074646,
0.42007890343666077,
-0.19408874213695526,
-0.7839327454566956,
-1.4733474254608154,
0.40228328108787537,
-0.240679427981... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.