file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/errors/form_must_be_one_of/index.md | JavaScript - Errors - Form must be one of - Examples - Invalid cases:
Example:
"foo".normalize("nfc"); // RangeError
"foo".normalize(" NFC "); // RangeError | [
-0.3870536684989929,
0.8819828629493713,
-0.9722650647163391,
-0.28831741213798523,
-0.4292086362838745,
-0.6358899474143982,
0.5013778805732727,
1.2763255834579468,
-1.178294062614441,
0.20184315741062164,
-0.5249573588371277,
-0.9915199279785156,
0.09552852064371109,
-0.5160346627235413,... |
javascript/reference/errors/form_must_be_one_of/index.md | JavaScript - Errors - Form must be one of - Examples - Valid cases:
Example:
"foo".normalize("NFC"); // 'foo' | [
0.4118424654006958,
0.5286179780960083,
-0.8385840058326721,
-0.17848581075668335,
-0.33892005681991577,
-0.4809211790561676,
0.9951338768005371,
1.060904860496521,
-1.0125092267990112,
0.1486230343580246,
-0.5756309032440186,
-1.4905058145523071,
0.21226271986961365,
-0.353275865316391,
... |
javascript/reference/errors/invalid_array_length/index.md | JavaScript - Errors - Invalid array length:
The JavaScript exception "Invalid array length" occurs when specifying an array length that is either negative, a floating number or exceeds the maximum supported by the platform (i.e., when creating an `Array` or `ArrayBuffer`, or when setting the `length` property).
The m... | [
-0.05979067087173462,
-0.5181284546852112,
-1.3008238077163696,
1.2440632581710815,
-0.1454683244228363,
-0.8735961318016052,
0.037232086062431335,
0.2123906910419464,
-0.7280987501144409,
0.36094653606414795,
-0.7080634832382202,
0.5004680156707764,
-0.32412728667259216,
-0.18518304824829... |
javascript/reference/errors/invalid_array_length/index.md | JavaScript - Errors - Invalid array length - Message:
Example:
RangeError: invalid array length (V8-based & Firefox)
RangeError: Array size is not a small enough positive integer. (Safari)
RangeError: Invalid array buffer length (V8-based)
RangeError: length too large (Safari) | [
-0.7349939942359924,
0.102861188352108,
-1.5148060321807861,
-0.44362857937812805,
-0.571330726146698,
-0.8611214756965637,
0.298916757106781,
0.49545198678970337,
-0.7834867835044861,
0.060847315937280655,
-0.009847471490502357,
-0.029451442882418633,
-0.4546702206134796,
-0.5797579884529... |
javascript/reference/errors/invalid_array_length/index.md | JavaScript - Errors - Invalid array length - Error type:
`RangeError` | [
-0.2377151995897293,
0.12680427730083466,
-1.3001686334609985,
-0.08163157105445862,
-0.7510914206504822,
-0.5478112697601318,
0.48366692662239075,
1.772487998008728,
-1.3105483055114746,
-0.9041580557823181,
0.0018818144453689456,
0.13023653626441956,
-0.5188177824020386,
-0.4529378712177... |
javascript/reference/errors/invalid_array_length/index.md | JavaScript - Errors - Invalid array length - What went wrong?:
The error might appear when attempting to produce an `Array` or `ArrayBuffer` with an invalid length, which includes:
- Negative length, via the constructor or setting the `length` property.
- Non-integer length, via the constructor or setting the `length... | [
0.4612157642841339,
-0.5771309733390808,
-1.4995968341827393,
1.0375314950942993,
-0.2688233554363251,
-0.3515247404575348,
-0.5460293292999268,
0.1634194403886795,
-0.46203944087028503,
0.5425019264221191,
-0.1368074268102646,
0.36684107780456543,
-0.02575751394033432,
-0.3012410700321197... |
javascript/reference/errors/invalid_array_length/index.md | JavaScript - Errors - Invalid array length - Examples - Invalid cases:
Example:
new Array(2 ** 40);
new Array(-1);
new ArrayBuffer(2 ** 32); // 32-bit system
new ArrayBuffer(-1);
const a = [];
a.length -= 1; // set the length property to -1
const b = new Array(2 ** 32 - 1);
b.length += 1; // set the length property... | [
-0.3266293406486511,
-0.14375914633274078,
-1.5597175359725952,
0.7868866324424744,
-0.020919358357787132,
-0.5130748748779297,
0.1639871746301651,
1.3815757036209106,
-0.779437780380249,
0.08099882304668427,
-0.5268482565879822,
0.18477682769298553,
-0.06880497932434082,
-0.13283538818359... |
javascript/reference/errors/invalid_array_length/index.md | JavaScript - Errors - Invalid array length - Examples - Valid cases:
Example:
[2 ** 40]; // [ 1099511627776 ]
[-1]; // [ -1 ]
new ArrayBuffer(2 ** 31 - 1);
new ArrayBuffer(2 ** 33); // 64-bit systems after Firefox 89
new ArrayBuffer(0);
const a = [];
a.length = Math.max(0, a.length - 1);
const b = new Array(2 ** 32... | [
-0.3950473368167877,
-0.211272731423378,
-0.8686678409576416,
0.5225620269775391,
0.17970910668373108,
-0.8674334287643433,
0.2492358684539795,
0.9266929030418396,
-0.612949550151825,
0.37427639961242676,
-0.8400716185569763,
0.4563228487968445,
-0.1779666692018509,
-0.2157013714313507,
... |
javascript/reference/errors/bad_strict_arguments_eval/index.md | JavaScript - Errors - Bad strict arguments eval:
The JavaScript strict mode-only exception "'arguments' can't be defined or assigned to in strict mode code" or "'eval' can't be defined or assigned to in strict mode code" occurs when attempting to create a `binding` called `arguments` or `eval`, or assign to such a nam... | [
-0.01990494690835476,
-0.1948767453432083,
0.06682979315519333,
0.551624059677124,
-0.7192013263702393,
-1.0237109661102295,
0.6427525877952576,
1.0343495607376099,
-0.4310700297355652,
0.015792615711688995,
-0.4843507409095764,
-1.0918657779693604,
-0.28718113899230957,
-0.163108438253402... |
javascript/reference/errors/bad_strict_arguments_eval/index.md | JavaScript - Errors - Bad strict arguments eval - Message:
Example:
SyntaxError: Unexpected eval or arguments in strict mode (V8-based)
SyntaxError: 'arguments' can't be defined or assigned to in strict mode code (Firefox)
SyntaxError: Cannot modify 'arguments' in strict mode. (Safari)
SyntaxError: Cannot destructure... | [
-0.1961997002363205,
-0.11693452298641205,
-0.32681119441986084,
-0.4040640592575073,
-0.7930049300193787,
-1.6239076852798462,
0.5819197297096252,
1.0970218181610107,
0.2629666030406952,
0.08335112035274506,
0.04623515531420708,
-0.7019851803779602,
-0.5057535767555237,
0.1417853087186813... |
javascript/reference/errors/bad_strict_arguments_eval/index.md | JavaScript - Errors - Bad strict arguments eval - Error type:
`SyntaxError` | [
-0.5529965162277222,
-0.17241986095905304,
-0.14695091545581818,
-0.09444547444581985,
-0.18581385910511017,
-0.8841251730918884,
1.0130045413970947,
2.1042122840881348,
-0.7260941863059998,
-0.2415424883365631,
0.13944745063781738,
-0.7381583452224731,
-0.3482251763343811,
-0.088800683617... |
javascript/reference/errors/bad_strict_arguments_eval/index.md | JavaScript - Errors - Bad strict arguments eval - What went wrong?:
In strict mode, the names `arguments` and `eval` behave as if they are reserved words: you cannot make they refer to anything other than the `arguments` object in functions or the global `eval` function. | [
0.32228022813796997,
-0.14812688529491425,
-0.3901112675666809,
0.5885112285614014,
-0.5046483278274536,
-1.511696696281433,
0.7836931943893433,
1.2539210319519043,
-0.3592982292175293,
-0.14313296973705292,
-0.5697792172431946,
-0.785935640335083,
-0.61403888463974,
-0.3594803512096405,
... |
javascript/reference/errors/bad_strict_arguments_eval/index.md | JavaScript - Errors - Bad strict arguments eval - Examples - Invalid cases:
Example:
"use strict";
const arguments = [1, 2, 3];
console.log(Math.max(...arguments));
function foo(...arguments) {
console.log(arguments);
} | [
0.024113483726978302,
-0.21124103665351868,
-0.7726788520812988,
0.1968173235654831,
-0.2590056359767914,
-1.154902458190918,
0.3706589341163635,
1.1406819820404053,
-0.7127290368080139,
0.4452817440032959,
-0.24414201080799103,
-0.4820226728916168,
-0.056512050330638885,
-0.47273963689804... |
javascript/reference/errors/bad_strict_arguments_eval/index.md | JavaScript - Errors - Bad strict arguments eval - Examples - Valid cases:
Example:
"use strict";
const args = [1, 2, 3];
console.log(Math.max(...args));
function foo(...args) {
console.log(args);
} | [
-0.21928706765174866,
-0.00809094961732626,
-0.9497133493423462,
0.14680509269237518,
-0.2864089608192444,
-0.9403442144393921,
0.18463487923145294,
0.7542557716369629,
-0.7481329441070557,
0.3947405517101288,
-0.2880978286266327,
-0.4058687388896942,
-0.25232094526290894,
-0.4599273800849... |
javascript/reference/errors/setter_one_argument/index.md | JavaScript - Errors - Setter one argument:
The JavaScript exception "setter functions must have one argument" occurs when a setter is declared and the parameter list is not consisted of exactly one formal parameter. | [
-0.4349046051502228,
-0.25256797671318054,
-2.1643824577331543,
1.2532230615615845,
-0.00867416150867939,
-1.6612045764923096,
-0.2108028084039688,
0.8732855916023254,
-0.6926167011260986,
-0.5893431305885315,
-0.37341201305389404,
-0.9271648526191711,
0.5887799859046936,
-0.72014200687408... |
javascript/reference/errors/setter_one_argument/index.md | JavaScript - Errors - Setter one argument - Message:
Example:
SyntaxError: Setter must have exactly one formal parameter. (V8-based)
SyntaxError: Setter function argument must not be a rest parameter (V8-based)
SyntaxError: setter functions must have one argument (Firefox)
SyntaxError: Unexpected token ','. setter fu... | [
-0.8826804161071777,
0.011009280569851398,
-1.8959331512451172,
0.26997482776641846,
-0.24114398658275604,
-1.7223913669586182,
0.28791946172714233,
1.156325101852417,
-0.19031740725040436,
-0.3242780268192291,
0.38412344455718994,
-0.230272114276886,
0.540645182132721,
-0.4163736402988434... |
javascript/reference/errors/setter_one_argument/index.md | JavaScript - Errors - Setter one argument - Error type:
`SyntaxError` | [
-0.35549333691596985,
-0.04934578016400337,
-0.8884977698326111,
0.554824709892273,
-0.24566195905208588,
-1.052680492401123,
1.2065216302871704,
2.2689766883850098,
0.057209793478250504,
-0.9967659711837769,
0.2329489141702652,
-0.3399896025657654,
0.5355713963508606,
-0.36263567209243774... |
javascript/reference/errors/setter_one_argument/index.md | JavaScript - Errors - Setter one argument - What went wrong?:
The `set` property syntax looks like a function, but it is stricter and not all function syntax is allowed. A setter is always invoked with exactly one argument, so defining it with any other number of parameters is likely an error. This parameter can be de... | [
-0.6351695656776428,
-0.3227996230125427,
-1.6490718126296997,
1.1331549882888794,
0.06968405842781067,
-1.8841552734375,
-0.1297825276851654,
1.1757289171218872,
0.25582200288772583,
-0.21049410104751587,
-0.25892823934555054,
-0.08165230602025986,
0.4704100489616394,
-0.3829575777053833,... |
javascript/reference/errors/setter_one_argument/index.md | JavaScript - Errors - Setter one argument - Examples - Invalid cases:
Example:
const obj = {
set value() {
this._value = Math.random();
},
}; | [
-0.5669282078742981,
0.6120894551277161,
-1.124883770942688,
0.6299653649330139,
-0.29802507162094116,
-0.6860510110855103,
0.9862356185913086,
1.2865054607391357,
-0.4585654139518738,
-0.24520155787467957,
-0.4736650586128235,
-0.3094356656074524,
0.7487362027168274,
-0.7302941679954529,
... |
javascript/reference/errors/setter_one_argument/index.md | JavaScript - Errors - Setter one argument - Examples - Valid cases:
Example:
// You must declare one parameter, even if you don't use it
const obj = {
set value(_ignored) {
this._value = Math.random();
},
};
// You can also declare a normal method instead
const obj = {
setValue() {
this._value = Math.r... | [
-0.5481157898902893,
0.723595380783081,
-1.0901678800582886,
1.2951533794403076,
-0.33440423011779785,
-1.3947280645370483,
0.5983194708824158,
0.6858399510383606,
-0.022561613470315933,
0.040091194212436676,
-0.5648926496505737,
-0.43061763048171997,
0.9444153308868408,
-0.555916309356689... |
javascript/reference/errors/stmt_after_return/index.md | JavaScript - Errors - Stmt after return:
The JavaScript warning "unreachable code after return statement" occurs when using an expression after a `return` statement, or when using a semicolon-less return statement but including an expression directly after. | [
0.3121957778930664,
0.2821611762046814,
-1.1994494199752808,
0.41173022985458374,
-0.35008004307746887,
-1.8752810955047607,
0.46143367886543274,
-0.03974653035402298,
-1.026681661605835,
0.6418627500534058,
0.005771140567958355,
0.0499916672706604,
-0.05547468364238739,
-0.389240831136703... |
javascript/reference/errors/stmt_after_return/index.md | JavaScript - Errors - Stmt after return - Message:
Example:
Warning: unreachable code after return statement (Firefox) | [
-0.19955849647521973,
0.612144410610199,
-1.0696022510528564,
-0.6677913069725037,
-0.7630980610847473,
-1.2893623113632202,
0.6921718716621399,
0.48839277029037476,
-1.2691887617111206,
0.4264863133430481,
0.44506022334098816,
0.045769352465867996,
-0.21439410746097565,
-0.267306327819824... |
javascript/reference/errors/stmt_after_return/index.md | JavaScript - Errors - Stmt after return - Error type:
Warning | [
-0.22663533687591553,
-0.09862195700407028,
-1.8748373985290527,
-0.18106333911418915,
-0.8798772692680359,
-0.5088786482810974,
0.8971645832061768,
1.301129937171936,
-1.2970290184020996,
0.05037989839911461,
0.08126462996006012,
0.4606897532939911,
0.23140710592269897,
-0.025268606841564... |
javascript/reference/errors/stmt_after_return/index.md | JavaScript - Errors - Stmt after return - What went wrong?:
Unreachable code after a return statement might occur in these situations:
- When using an expression after a `return` statement, or
- when using a semicolon-less return statement but including an expression directly after.
When an expression exists after a... | [
-0.3199736475944519,
0.7233399152755737,
-0.5051712989807129,
0.6082194447517395,
-0.45078858733177185,
-1.5616166591644287,
0.5839123129844666,
0.15502817928791046,
-0.5856003165245056,
0.6862247586250305,
-0.18246465921401978,
0.29935118556022644,
-0.12321737408638,
-0.01924130879342556,... |
javascript/reference/errors/stmt_after_return/index.md | JavaScript - Errors - Stmt after return - Examples - Invalid cases:
Example:
function f() {
let x = 3;
x += 4;
return x; // return exits the function immediately
x -= 3; // so this line will never run; it is unreachable
}
function g() {
return // this is treated like `return;`
3 + 4; // so ... | [
-0.8040326833724976,
0.41914862394332886,
-1.1362961530685425,
-0.31466150283813477,
0.3559216856956482,
-0.30249887704849243,
0.7569913268089294,
0.6708858609199524,
-1.2988072633743286,
0.28358855843544006,
-0.516953706741333,
0.4514803886413574,
0.6942098736763,
-0.20611067116260529,
... |
javascript/reference/errors/stmt_after_return/index.md | JavaScript - Errors - Stmt after return - Examples - Valid cases:
Example:
function f() {
let x = 3;
x += 4;
x -= 3;
return x; // OK: return after all other statements
}
function g() {
return 3 + 4 // OK: semicolon-less return with expression on the same line
} | [
-0.3364608883857727,
-0.37132883071899414,
-1.301485300064087,
0.16093362867832184,
0.6008715033531189,
-1.0110498666763306,
0.5258826017379761,
0.0770215094089508,
-1.0433800220489502,
-0.13126404583454132,
-0.6538984775543213,
0.012273016385734081,
0.29060089588165283,
-0.341669559478759... |
javascript/reference/errors/import_decl_module_top_level/index.md | JavaScript - Errors - import decl module top level:
The JavaScript exception "import declarations may only appear at top level of a module" occurs when an import declaration is not at the top level of a module. This might be because the import declaration is nested in other constructs (functions, blocks, etc.), or mor... | [
0.31410297751426697,
-0.8654184937477112,
-0.7044068574905396,
1.2554174661636353,
-0.0778806284070015,
-0.8150866627693176,
-0.24800582230091095,
0.6028901934623718,
-1.0456297397613525,
0.2080531269311905,
-0.005069890525192022,
-0.3212146759033203,
-0.5465971827507019,
0.222135692834854... |
javascript/reference/errors/import_decl_module_top_level/index.md | JavaScript - Errors - import decl module top level - Message:
Example:
SyntaxError: Cannot use import statement outside a module (V8-based)
SyntaxError: import declarations may only appear at top level of a module (Firefox)
SyntaxError: Unexpected identifier 'x'. import call expects one or two arguments. (Safari) | [
-0.39041411876678467,
-0.27707841992378235,
-1.3278791904449463,
0.7432314157485962,
-0.595754861831665,
-0.42718756198883057,
-0.17318035662174225,
0.7915961146354675,
-0.4923565685749054,
-0.018391521647572517,
-0.10169477015733719,
0.3037257492542267,
-0.37618958950042725,
0.04293482750... |
javascript/reference/errors/import_decl_module_top_level/index.md | JavaScript - Errors - import decl module top level - Error type:
`SyntaxError` | [
0.5342031121253967,
-0.18162502348423004,
-0.5842810869216919,
-0.24304480850696564,
-0.2200712263584137,
-0.5565271377563477,
0.29061833024024963,
0.9196351766586304,
-0.7793203592300415,
-0.5250134468078613,
0.6012993454933167,
0.3238052427768707,
-0.3370334208011627,
0.3961460590362549,... |
javascript/reference/errors/import_decl_module_top_level/index.md | JavaScript - Errors - import decl module top level - What went wrong?:
You may have an `import` declaration that's nested in another construct, such as a function or a block. The `import` declaration must be at the top level of the module. If you want to conditionally import a module, or lazily import it on demand, us... | [
0.373577356338501,
-0.046437252312898636,
-0.7316603660583496,
0.727746307849884,
0.3670763075351715,
-0.10912738740444183,
0.2754482626914978,
0.843552827835083,
-0.3253783583641052,
0.18055360019207,
-0.3408878743648529,
-0.09522681683301926,
-0.4724999666213989,
0.9357043504714966,
-0... |
javascript/reference/errors/import_decl_module_top_level/index.md | JavaScript - Errors - import decl module top level - Examples - Conditional imports:
You cannot use `import` inside other constructs, like you might do in Python.
Example:
if (writeOutput) {
import fs from "fs"; // SyntaxError
}
Either move the `import` to the top level, or use dynamic import.
Example:
if (writ... | [
0.06866694241762161,
-0.02939002960920334,
-0.44389083981513977,
0.7720906138420105,
0.20112228393554688,
-0.7907509803771973,
0.03412233665585518,
0.45970678329467773,
-0.6986135840415955,
0.7777739763259888,
-0.8574243187904358,
0.8345224261283875,
-0.17751635611057281,
0.130690470337867... |
javascript/reference/errors/import_decl_module_top_level/index.md | JavaScript - Errors - import decl module top level - Examples - Importing in a non-module script:
If you are loading the script from HTML, make sure to add the `type="module"` attribute to the `<script>` tag.
Example:
<script type="module" src="main.js"></script>
If for some reason you cannot migrate the script to ... | [
-0.7518743276596069,
-0.11745382845401764,
-0.5259767770767212,
0.4549296796321869,
-0.32470980286598206,
-0.5368536710739136,
0.49818864464759827,
0.30334722995758057,
-1.301161289215088,
0.6060553193092346,
-0.11021891981363297,
0.6100788712501526,
-0.5046029686927795,
0.0200814064592123... |
javascript/reference/errors/bad_return/index.md | JavaScript - Errors - Bad return:
The JavaScript exception "return not in function" occurs when a `return` statement is called outside of a function. | [
-0.22824330627918243,
0.41733601689338684,
-1.6560850143432617,
0.38670217990875244,
-0.4863889515399933,
-0.4148116707801819,
-0.10579514503479004,
1.1315875053405762,
-1.367110252380371,
0.1293872445821762,
-0.9777070879936218,
-0.10204094648361206,
-0.6262533068656921,
0.209059774875640... |
javascript/reference/errors/bad_return/index.md | JavaScript - Errors - Bad return - Message:
Example:
SyntaxError: Illegal return statement (V8-based)
SyntaxError: return not in function (Firefox)
SyntaxError: Return statements are only valid inside functions. (Safari) | [
-0.5660374760627747,
0.5819324851036072,
-1.1651451587677002,
-0.28576231002807617,
-0.7919932007789612,
-0.8015895485877991,
0.4884764850139618,
1.6003321409225464,
-0.677184522151947,
0.24000310897827148,
-0.1701546013355255,
0.0005882115219719708,
0.1572294533252716,
-0.4447188675403595... |
javascript/reference/errors/bad_return/index.md | JavaScript - Errors - Bad return - Error type:
`SyntaxError`. | [
-0.06557708978652954,
0.04081665724515915,
-0.7390642762184143,
-0.37350577116012573,
-0.5500776171684265,
-0.1465366780757904,
1.2557423114776611,
2.592700481414795,
-0.6597474813461304,
-0.6953215003013611,
0.07491802424192429,
0.014640972018241882,
-0.10192874819040298,
0.09264850616455... |
javascript/reference/errors/bad_return/index.md | JavaScript - Errors - Bad return - What went wrong?:
A `return` statement is called outside of a function. Maybe there are missing curly braces somewhere? The `return` statement must be in a function, because it ends function execution and specifies a value to be returned to the function caller. | [
-0.2647264003753662,
1.170847773551941,
-1.7406235933303833,
0.07001326233148575,
-0.10300884395837784,
-0.4339480996131897,
-0.505929708480835,
0.8101548552513123,
-0.9365810751914978,
0.16401410102844238,
-0.6264160871505737,
0.08463068306446075,
0.0502910315990448,
0.46102675795555115,
... |
javascript/reference/errors/bad_return/index.md | JavaScript - Errors - Bad return - Examples - Missing curly braces:
Example:
function cheer(score) {
if (score === 147)
return "Maximum!";
}
if (score > 100) {
return "Century!";
}
}
// SyntaxError: return not in function
The curly braces look correct at a first glance, but this code snippet is miss... | [
-1.3884767293930054,
0.8152644634246826,
-1.0878175497055054,
-0.27394169569015503,
0.1915266364812851,
-0.7298440337181091,
0.580935001373291,
1.1215221881866455,
-1.144606113433838,
0.5424548387527466,
0.3442623019218445,
-0.24958345293998718,
0.12430407106876373,
-0.5892000198364258,
... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object:
The JavaScript exception "right-hand side of 'in' should be an object" occurs when the `in` operator was used to search in strings, or in numbers, or other primitive types. It can only be used to check if a property is in an object. | [
-0.0926578938961029,
0.017252929508686066,
-1.2240055799484253,
0.9662390947341919,
0.0103322584182024,
-0.509996771812439,
0.8897548913955688,
1.520703673362732,
0.01521238312125206,
-0.2008608877658844,
-1.0860129594802856,
-1.7461663484573364,
0.688279390335083,
-1.0334903001785278,
0... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object - Message:
Example:
TypeError: Cannot use 'in' operator to search for 'x' in 'y' (V8-based & Firefox)
TypeError: right-hand side of 'in' should be an object, got null (Firefox)
TypeError: "y" is not an Object. (evaluating '"x" in "y"') (Safari) | [
-0.4364372491836548,
0.2194410115480423,
-1.3660115003585815,
-0.0805613249540329,
0.09796549379825592,
-0.1841069757938385,
0.24533309042453766,
1.6116782426834106,
0.29056516289711,
-0.24457290768623352,
0.13842655718326569,
-2.0244367122650146,
0.8423492908477783,
-0.8158203959465027,
... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object - Error type:
`TypeError` | [
-0.17930814623832703,
0.42884987592697144,
-1.1795371770858765,
-0.24975211918354034,
-0.2041339874267578,
0.9472610354423523,
0.7825573682785034,
2.0870747566223145,
-0.42354854941368103,
-0.7202573418617249,
0.3342510461807251,
-2.1533684730529785,
0.5130215883255005,
-0.6621587872505188... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object - What went wrong?:
The `in` operator can only be used to check if a property is in an object. You can't search in strings, or in numbers, or other primitive types. | [
-0.25654342770576477,
0.4462472200393677,
-1.4553998708724976,
0.5771986246109009,
0.5331292152404785,
-0.5648966431617737,
0.5075719356536865,
1.2368028163909912,
-0.30180543661117554,
-0.22013476490974426,
-0.7303534746170044,
-2.0903046131134033,
0.6638036370277405,
-0.9321286678314209,... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object - Examples - Searching in strings:
Unlike in other programming languages (e.g., Python), you can't search in strings using the `in` operator.
Example:
"Hello" in "Hello World";
// TypeError: cannot use 'in' operator to search for 'Hello' in 'Hello World'
Instead you will ... | [
-1.134523868560791,
0.1562802940607071,
-0.7966946959495544,
0.49873459339141846,
0.2840960621833801,
-0.5830250382423401,
-0.6277719140052795,
0.18904510140419006,
-0.7330307960510254,
-0.6366969347000122,
-0.42041879892349243,
-1.587943434715271,
1.3242677450180054,
-0.7635143399238586,
... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object - Examples - The operand can't be null or undefined:
Make sure the object you are inspecting isn't actually `null` or `undefined`.
Example:
const foo = null;
"bar" in foo;
// TypeError: cannot use 'in' operator to search for 'bar' in 'foo' (Chrome)
// TypeError: right-hand... | [
-0.7417873740196228,
0.0921814888715744,
-1.4728056192398071,
0.5190403461456299,
0.4715563654899597,
-0.7435275316238403,
-0.06311701238155365,
0.6646013855934143,
-0.033476024866104126,
0.7655741572380066,
-0.3170306384563446,
-1.4739737510681152,
0.9432028532028198,
-0.49977347254753113... |
javascript/reference/errors/in_operator_no_object/index.md | JavaScript - Errors - in operator no object - Examples - Searching in arrays:
Be careful when using the `in` operator to search in `Array` objects. The `in` operator checks the index number, not the value at that index.
Example:
const trees = ["redwood", "bay", "cedar", "oak", "maple"];
3 in trees; // true
"oak" in ... | [
0.3830152153968811,
0.20457452535629272,
-1.977107048034668,
0.6012028455734253,
0.34550178050994873,
-0.7705050706863403,
0.4232519567012787,
1.3377805948257446,
-0.7531160712242126,
0.18330541253089905,
-0.6083234548568726,
-1.8395100831985474,
1.1035513877868652,
-0.5615043044090271,
... |
javascript/reference/errors/bad_regexp_flag/index.md | JavaScript - Errors - Bad regexp flag:
The JavaScript exception "invalid regular expression flag" occurs when the flags in a regular expression contain any flag that is not one of: `d`, `g`, `i`, `m`, `s`, `u`, `v`, or `y`. It may also be raised if the expression contains more than one instance of a valid flag, or whe... | [
-0.15934906899929047,
0.3164057433605194,
-0.9456139206886292,
0.13271509110927582,
-0.15739154815673828,
-1.2064921855926514,
0.3381277918815613,
1.1797864437103271,
-0.8363439440727234,
-0.5894153118133545,
-0.9896815419197083,
-0.7187907695770264,
-0.116494320333004,
-0.3254283368587494... |
javascript/reference/errors/bad_regexp_flag/index.md | JavaScript - Errors - Bad regexp flag - Message:
Example:
SyntaxError: Invalid flags supplied to RegExp constructor 'x' (V8-based)
SyntaxError: Invalid regular expression flags (V8-based)
SyntaxError: invalid regular expression flag x (Firefox)
SyntaxError: Invalid flags supplied to RegExp constructor. (Safari)
Synta... | [
-0.43522390723228455,
0.8977617025375366,
-0.4307911992073059,
-0.8016107082366943,
-0.8757421374320984,
-1.7390122413635254,
0.4580858051776886,
1.493152379989624,
-0.44070032238960266,
-0.21448864042758942,
0.020911211147904396,
-0.7007430195808411,
0.11598635464906693,
-0.60189241170883... |
javascript/reference/errors/bad_regexp_flag/index.md | JavaScript - Errors - Bad regexp flag - Error type:
`SyntaxError` | [
-0.33603647351264954,
0.7144536375999451,
-0.2688533663749695,
-0.7648590207099915,
-1.02288818359375,
-0.8747963905334473,
0.9855337142944336,
2.1773369312286377,
-0.45938608050346375,
-0.6466571092605591,
0.23627470433712006,
-0.6046019792556763,
0.17846016585826874,
-0.25327247381210327... |
javascript/reference/errors/bad_regexp_flag/index.md | JavaScript - Errors - Bad regexp flag - What went wrong?:
The regular expression contains invalid flags, or valid flags have been used more than once in the expression.
The valid (allowed) flags are `d`, `g`, `i`, `m`, `s`, `u`, `v`, and `y`. They are introduced in more detail in Regular expressions > Advanced search... | [
-0.09309910237789154,
0.5677846074104309,
-1.3832048177719116,
-0.45938485860824585,
-0.1626797318458557,
-1.3759866952896118,
0.26852506399154663,
0.7991219162940979,
-0.2266276776790619,
0.08866867423057556,
-1.000868558883667,
-0.454746276140213,
0.10080613940954208,
0.17713604867458344... |
javascript/reference/errors/bad_regexp_flag/index.md | JavaScript - Errors - Bad regexp flag - Examples:
In a regular expression literal, which consists of a pattern enclosed between slashes, the flags are defined after the second slash. Regular expression flags can be used separately or together in any order. This syntax shows how to declare the flags using the regular e... | [
-0.7482117414474487,
0.8359752297401428,
-0.26240649819374084,
-0.08961393684148788,
-0.2012007236480713,
-0.9868333339691162,
0.2669387459754944,
0.5221230983734131,
-0.32771602272987366,
0.18380028009414673,
-0.5733575820922852,
0.19214700162410736,
0.11666169762611389,
-0.01279680989682... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name:
The JavaScript exception "missing variable name" is a common error. It is usually caused by omitting a variable name or a typographic error. | [
-0.7081298232078552,
-0.4934939742088318,
-1.6238890886306763,
0.26131629943847656,
-0.3761734664440155,
-1.2184875011444092,
0.7792874574661255,
1.1195822954177856,
-0.8582819700241089,
-0.7366024255752563,
-0.14363150298595428,
-1.3679234981536865,
-1.110152006149292,
-0.1068003177642822... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - Message:
Example:
SyntaxError: missing variable name (Firefox)
SyntaxError: Unexpected token '='. Expected a parameter pattern or a ')' in parameter list. (Safari) | [
-1.27065110206604,
-0.02945300005376339,
-1.6300163269042969,
-0.06544169038534164,
-0.973132312297821,
-0.7294467687606812,
1.3158347606658936,
1.281609296798706,
-0.8129674196243286,
-0.4389508366584778,
0.9154882431030273,
-0.1402883231639862,
-0.390618234872818,
-0.5916961431503296,
... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - Error type:
`SyntaxError` | [
-0.4317030906677246,
0.1554183065891266,
-1.0040876865386963,
0.02499702386558056,
-0.9063071012496948,
-0.3618752658367157,
1.2771002054214478,
2.5507991313934326,
-0.4862900674343109,
-1.2303497791290283,
0.7565726041793823,
-0.6151282787322998,
-0.1607641875743866,
-0.35969898104667664,... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - What went wrong?:
A variable is missing a name. The cause is most likely a typo or a forgotten variable name. Make sure that you've provided the name of the variable before the `=` sign.
When declaring multiple variables at the same time, make sure that the previous lines/decl... | [
-0.9706816673278809,
-0.030925506725907326,
-1.4086073637008667,
0.2630027234554291,
-0.46907302737236023,
-1.0877281427383423,
0.4992235004901886,
1.172967553138733,
-1.193076491355896,
-0.5913835763931274,
0.5705165863037109,
-0.5064547061920166,
-0.5549249649047852,
-0.20261503756046295... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - Examples - Missing a variable name:
Example:
const = "foo";
It is easy to forget to assign a name for your variable!
Example:
const description = "foo"; | [
-0.34814488887786865,
-0.10872108489274979,
-1.5365982055664062,
0.1919008195400238,
-0.3153495490550995,
-1.0906263589859009,
1.199281930923462,
1.246783971786499,
-0.9593145847320557,
-0.3602215349674225,
-0.14217866957187653,
-0.7643194198608398,
-0.15060630440711975,
-0.115914784371852... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - Examples - Reserved keywords can't be variable names:
There are a few variable names that are reserved keywords. You can't use these. Sorry :(
Example:
const debugger = "whoop";
// SyntaxError: missing variable name | [
0.053449444472789764,
0.3351455628871918,
-0.9842492341995239,
0.11734205484390259,
-0.8702260851860046,
-1.18351149559021,
0.3735186457633972,
1.1736853122711182,
-0.2082599550485611,
-0.8494963645935059,
0.13661029934883118,
-0.3748306632041931,
-0.6584583520889282,
-1.0584975481033325,
... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - Examples - Declaring multiple variables:
Pay special attention to commas when declaring multiple variables. Is there an excess comma, or did you use commas instead of semicolons? Did you remember to assign values for all your `const` variables?
Example:
let x, y = "foo",
cons... | [
-0.511398196220398,
0.12260593473911285,
-1.1477813720703125,
0.9146732091903687,
-0.4045588970184326,
-0.7168803811073303,
0.8972833752632141,
1.0815743207931519,
-1.0428884029388428,
-0.3248913288116455,
0.4182053506374359,
-0.4942300319671631,
-0.6560116410255432,
-0.583877682685852,
... |
javascript/reference/errors/no_variable_name/index.md | JavaScript - Errors - No variable name - Examples - Arrays:
`Array` literals in JavaScript need square brackets around the values. This won't work:
Example:
const arr = 1,2,3,4,5;
// SyntaxError: missing variable name
This would be correct:
Example:
const arr = [1, 2, 3, 4, 5]; | [
-0.634811520576477,
-0.214788019657135,
-0.7179588675498962,
0.008422828279435635,
-0.02302355319261551,
-0.28099700808525085,
0.6217560768127441,
0.2612076699733734,
-1.164660096168518,
-0.5338792204856873,
0.09742419421672821,
-0.34880706667900085,
-0.5371199250221252,
-0.971815466880798... |
javascript/reference/errors/regex_nothing_to_repeat/index.md | JavaScript - Errors - Regex nothing to repeat:
The JavaScript exception "nothing to repeat" or "invalid quantifier in regular expression" occurs when a quantifier in a regular expression is applied to nothing or applied to an assertion. | [
-0.21052157878875732,
0.8705564737319946,
-0.9802509546279907,
0.011756645515561104,
-0.4236789345741272,
-1.0307585000991821,
0.271492600440979,
1.1340776681900024,
-1.1087284088134766,
-0.6626573801040649,
-0.9680960178375244,
-1.6656211614608765,
-0.30180588364601135,
0.1635908633470535... |
javascript/reference/errors/regex_nothing_to_repeat/index.md | JavaScript - Errors - Regex nothing to repeat - Message:
Example:
SyntaxError: Invalid regular expression: /\b+/: Nothing to repeat (V8-based)
SyntaxError: Invalid regular expression: /(?=)+/u: Invalid quantifier (V8-based)
SyntaxError: nothing to repeat (Firefox)
SyntaxError: invalid quantifier in regular expression... | [
-0.5250045657157898,
1.231737732887268,
-1.0110340118408203,
-0.7785241603851318,
-0.5056172609329224,
-1.0033410787582397,
0.6581236124038696,
1.9031740427017212,
-0.3884069323539734,
-0.34428927302360535,
-0.3212668001651764,
-0.8972068428993225,
-0.04305483400821686,
-0.3857628703117370... |
javascript/reference/errors/regex_nothing_to_repeat/index.md | JavaScript - Errors - Regex nothing to repeat - Error type:
`SyntaxError` | [
-0.1767858862876892,
1.0702111721038818,
-0.46640896797180176,
-1.2726476192474365,
-1.121546745300293,
-0.7286109924316406,
1.0565983057022095,
2.5540266036987305,
-0.3602365255355835,
-1.3665941953659058,
0.08525330573320389,
-0.529467761516571,
-0.14422912895679474,
0.35026881098747253,... |
javascript/reference/errors/regex_nothing_to_repeat/index.md | JavaScript - Errors - Regex nothing to repeat - What went wrong?:
Quantifiers are used to specify how many times a character or group of characters can appear in a regular expression. For example, `a{3}` matches the character `a` exactly three times. Therefore, if the thing preceding the quantifier is not something th... | [
-0.21228672564029694,
0.6180296540260315,
-0.6828753352165222,
-0.9542432427406311,
-0.21797960996627808,
-1.1272658109664917,
1.0378854274749756,
0.5817513465881348,
-0.641815721988678,
-0.7020776867866516,
-0.739886462688446,
-0.9408890604972839,
0.25713226199150085,
-0.08980444073677063... |
javascript/reference/errors/regex_nothing_to_repeat/index.md | JavaScript - Errors - Regex nothing to repeat - Examples - Invalid cases:
Example:
/\b+/; // \b is a word boundary assertion, it doesn't consume characters
/(*hello*)/; | [
0.03628456965088844,
0.4444464445114136,
-1.0906400680541992,
-0.6643050909042358,
-0.7759727239608765,
-1.110759973526001,
1.3623703718185425,
1.3577589988708496,
-1.085026741027832,
-0.8804201483726501,
-0.5883089900016785,
-1.0622103214263916,
0.2936391234397888,
-0.023735102266073227,
... |
javascript/reference/errors/regex_nothing_to_repeat/index.md | JavaScript - Errors - Regex nothing to repeat - Examples - Valid cases:
Example:
/b+/; // b is a character, it can be repeated
/(\*hello\*)/; // Escape the asterisks to match them literally | [
0.05140325427055359,
0.7974088788032532,
-0.7697978019714355,
-0.1626286655664444,
-0.2615768611431122,
-1.0709679126739502,
1.1359646320343018,
1.213733434677124,
-0.6817275881767273,
-0.6578055620193481,
-0.6075276136398315,
-0.3847956955432892,
-0.09816479682922363,
-0.00420020893216133... |
javascript/reference/errors/regex_incomplete_quantifier/index.md | JavaScript - Errors - Regex incomplete quantifier:
The JavaScript exception "incomplete quantifier in regular expression" occurs when a regular expression pattern contains a `{`, but it does not start a valid quantifier. | [
-0.5498701333999634,
0.8020582795143127,
-1.0892630815505981,
0.12015733867883682,
-0.2153811752796173,
-0.9934998750686646,
0.5888206958770752,
1.2961549758911133,
-0.7709726691246033,
-0.6566934585571289,
-0.667261004447937,
-1.5130925178527832,
-0.289485901594162,
-0.2974318861961365,
... |
javascript/reference/errors/regex_incomplete_quantifier/index.md | JavaScript - Errors - Regex incomplete quantifier - Message:
Example:
SyntaxError: Invalid regular expression: /1{/u: Incomplete quantifier (V8-based)
SyntaxError: incomplete quantifier in regular expression (Firefox)
SyntaxError: Invalid regular expression: incomplete {} quantifier for Unicode pattern (Safari) | [
-0.9182993769645691,
1.0141620635986328,
-1.2259033918380737,
-0.7667454481124878,
-0.36347106099128723,
-1.350786566734314,
0.692954421043396,
1.3232351541519165,
-0.7492246627807617,
-0.1856236606836319,
-0.20130135118961334,
-0.9465333223342896,
0.07356441766023636,
-0.8191784024238586,... |
javascript/reference/errors/regex_incomplete_quantifier/index.md | JavaScript - Errors - Regex incomplete quantifier - Error type:
`SyntaxError` | [
-0.6426365971565247,
0.8840291500091553,
-0.019538648426532745,
-0.6818625330924988,
-0.9546199440956116,
-0.7326998710632324,
1.193119764328003,
2.109731674194336,
-0.5350873470306396,
-0.8701773285865784,
0.17751438915729523,
-0.801357626914978,
-0.23105740547180176,
-0.09153776615858078... |
javascript/reference/errors/regex_incomplete_quantifier/index.md | JavaScript - Errors - Regex incomplete quantifier - What went wrong?:
A `{` character in a regular expression pattern starts a quantifier. A valid quantifier is in the form `{n}`, `{n,}`, or `{n,m}`, where `n` and `m` are non-negative integers and `m` is not less than `n`. If the `{` character does not start a valid q... | [
-0.6444476842880249,
0.7347319722175598,
-0.6249525547027588,
-1.0849425792694092,
0.12146969139575958,
-1.0887659788131714,
0.3283645808696747,
1.613025426864624,
0.28864192962646484,
-0.28087133169174194,
-0.06719145178794861,
-1.0461106300354004,
-0.6463478207588196,
-0.5069325566291809... |
javascript/reference/errors/regex_incomplete_quantifier/index.md | JavaScript - Errors - Regex incomplete quantifier - Examples - Invalid cases:
Example:
/1{/u;
/1{a}/u;
/1{}/u;
/1{1,2,3}/u;
/1{1, 2}/u; | [
-0.40316224098205566,
1.4866693019866943,
-1.2608702182769775,
-0.6069243550300598,
-0.3832610845565796,
-0.7873643040657043,
0.45415961742401123,
1.5102440118789673,
-1.3577954769134521,
-0.31037601828575134,
-0.19014380872249603,
-0.9250484704971313,
0.44997215270996094,
-0.8297783732414... |
javascript/reference/errors/regex_incomplete_quantifier/index.md | JavaScript - Errors - Regex incomplete quantifier - Examples - Valid cases:
Example:
/1{1}/u;
/1{1,}/u;
/1{1,2}/u; | [
-0.26834142208099365,
1.3486896753311157,
-1.1154539585113525,
-0.25478580594062805,
-0.1243322342634201,
-0.917086124420166,
0.5121816396713257,
1.366804838180542,
-1.3448572158813477,
-0.10147152841091156,
-0.28962382674217224,
-1.2126857042312622,
0.16651126742362976,
-0.563799679279327... |
javascript/reference/errors/deprecated_octal_escape_sequence/index.md | JavaScript - Errors - Deprecated octal escape sequence:
The JavaScript exception "octal escape sequences can't be used in untagged template literals or in strict mode code" occurs when octal escape sequences are used in strict mode string literals or untagged template literals. | [
-1.2378369569778442,
0.05062832310795784,
-0.9757561087608337,
0.16601425409317017,
-0.741021990776062,
-0.9774246215820312,
1.117141604423523,
0.5847368240356445,
-1.236146330833435,
-0.3214479982852936,
-0.6795637607574463,
-0.6973338723182678,
-0.2575277090072632,
-0.5190858840942383,
... |
javascript/reference/errors/deprecated_octal_escape_sequence/index.md | JavaScript - Errors - Deprecated octal escape sequence - Message:
Example:
SyntaxError: Octal escape sequences are not allowed in strict mode. (V8-based)
SyntaxError: \8 and \9 are not allowed in strict mode. (V8-based)
SyntaxError: Octal escape sequences are not allowed in template strings. (V8-based)
SyntaxError: \... | [
-0.5356237888336182,
0.3068511188030243,
-1.1481164693832397,
-0.0003311767941340804,
-0.43968698382377625,
-1.1413216590881348,
0.979556143283844,
1.0383906364440918,
-0.4407273530960083,
-0.1616993099451065,
-0.6451413035392761,
-0.6027308106422424,
-0.15835915505886078,
-0.3169756829738... |
javascript/reference/errors/deprecated_octal_escape_sequence/index.md | JavaScript - Errors - Deprecated octal escape sequence - Error type:
`SyntaxError` | [
-0.5228649973869324,
0.2820890545845032,
-1.251698613166809,
-0.7848864197731018,
-0.6028386950492859,
-1.1111551523208618,
1.6392430067062378,
1.906969428062439,
-0.6306295394897461,
-0.3947329819202423,
-0.17742684483528137,
-0.5440669059753418,
-0.2639157176017761,
0.04939543828368187,
... |
javascript/reference/errors/deprecated_octal_escape_sequence/index.md | JavaScript - Errors - Deprecated octal escape sequence - What went wrong?:
The string escape sequence of the form `\` followed by any number of digits, except a single `0`, is deprecated. If you want to represent a character by its code point value, you should use the `\x` or `\u` escape sequence instead, such as `\x0... | [
-1.7897298336029053,
-0.31565654277801514,
-0.8988304138183594,
-0.6515374183654785,
0.24562926590442657,
-0.9571784734725952,
0.9931350350379944,
0.5338311791419983,
-1.0863405466079712,
0.02854873612523079,
-0.12251708656549454,
-0.3787519335746765,
-0.3169756233692169,
-0.70028686523437... |
javascript/reference/errors/deprecated_octal_escape_sequence/index.md | JavaScript - Errors - Deprecated octal escape sequence - Examples - Octal escape sequences:
Example:
"use strict";
"\251";
// SyntaxError: octal escape sequences can't be used in untagged template literals or in strict mode code | [
-1.149106502532959,
0.37090203166007996,
-1.1589277982711792,
-0.3138214945793152,
-0.638601541519165,
-0.9406735301017761,
1.2872990369796753,
0.9440006017684937,
-1.1527292728424072,
-0.04845518618822098,
-0.9724972248077393,
-0.6645605564117432,
-0.5613517165184021,
-0.6483199596405029,... |
javascript/reference/errors/deprecated_octal_escape_sequence/index.md | JavaScript - Errors - Deprecated octal escape sequence - Examples - Valid octal numbers:
For octal escape sequences, you can use hexadecimal escape sequences instead:
Example:
"\xA9";
If you want to represent some source text literally without interpreting any escape sequence, use `String.raw`:
Example:
String.ra... | [
-1.3170398473739624,
0.3219064176082611,
-0.6514542102813721,
-0.3811807930469513,
-0.22802257537841797,
-1.6874635219573975,
1.172126293182373,
0.219725102186203,
-0.3395429253578186,
0.14532962441444397,
-0.7787918448448181,
-0.03403180465102196,
-0.26364225149154663,
-0.4490196108818054... |
javascript/reference/errors/not_defined/index.md | JavaScript - Errors - Not defined:
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere. | [
-0.35634368658065796,
0.3777570128440857,
-0.9589288234710693,
0.8899121880531311,
-0.8414965271949768,
-0.6900614500045776,
0.8761104345321655,
1.095697283744812,
-0.5005431175231934,
0.12986937165260315,
-0.19377398490905762,
-1.370455026626587,
-0.292704313993454,
-0.3490357995033264,
... |
javascript/reference/errors/not_defined/index.md | JavaScript - Errors - Not defined - Message:
Example:
ReferenceError: "x" is not defined (V8-based & Firefox)
ReferenceError: Can't find variable: x (Safari) | [
-0.29750022292137146,
0.37298500537872314,
-1.5716116428375244,
-0.05211315304040909,
-1.1348400115966797,
-0.4569335877895355,
1.3806699514389038,
1.008776068687439,
-0.3285820782184601,
-0.03325328603386879,
0.9489908814430237,
-1.1365132331848145,
-0.2573068141937256,
-0.561478018760681... |
javascript/reference/errors/not_defined/index.md | JavaScript - Errors - Not defined - Error type:
`ReferenceError`. | [
0.33416515588760376,
0.28594550490379333,
-0.892267107963562,
0.24094371497631073,
-0.5846738815307617,
0.7337167859077454,
1.6509462594985962,
1.7962946891784668,
-0.2786531448364258,
-0.7490862607955933,
0.07852257043123245,
-0.7683642506599426,
-0.023537857457995415,
-0.2253630161285400... |
javascript/reference/errors/not_defined/index.md | JavaScript - Errors - Not defined - What went wrong?:
There is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope.
Note: When loading a library (such as jQuery), make sure it is loaded before you access library var... | [
-0.9396007061004639,
0.4692394435405731,
-1.250791072845459,
0.4119533598423004,
-0.05271686613559723,
-0.7845522165298462,
0.6832439303398132,
0.9255101084709167,
-0.7987968325614929,
0.10504555702209473,
0.1955859363079071,
-0.6281625628471375,
-0.8110727071762085,
-0.29435279965400696,
... |
javascript/reference/errors/not_defined/index.md | JavaScript - Errors - Not defined - Examples - Variable not declared:
Example:
foo.substring(1); // ReferenceError: foo is not defined
The "foo" variable isn't defined anywhere. It needs to be some string, so that the `String.prototype.substring()` method will work.
Example:
const foo = "bar";
foo.substring(1); //... | [
-0.29987213015556335,
0.6401723623275757,
-1.4352805614471436,
-0.1365675926208496,
-0.06329301744699478,
-1.5825623273849487,
0.8613172173500061,
1.2191046476364136,
-0.9914580583572388,
0.27112844586372375,
-0.08695706725120544,
-1.10696542263031,
0.11531569808721542,
-0.1481659710407257... |
javascript/reference/errors/not_defined/index.md | JavaScript - Errors - Not defined - Examples - Wrong scope:
A variable needs to be available in the current context of execution. Variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function
Example:
function numbers() {
... | [
0.2796793282032013,
0.36541372537612915,
-1.2148796319961548,
0.12888051569461823,
0.42476657032966614,
-0.6699867248535156,
-0.37546536326408386,
-0.07219308614730835,
-0.41492506861686707,
0.13222767412662506,
0.18104670941829681,
-0.10945913940668106,
-0.018712803721427917,
-0.373495966... |
javascript/reference/errors/getter_no_arguments/index.md | JavaScript - Errors - Getter no arguments:
The JavaScript exception "getter functions must have no arguments" occurs when a getter is declared and the parameter list is non-empty. | [
-0.39175593852996826,
-0.09395020455121994,
-1.696245551109314,
0.2720111906528473,
-0.495254248380661,
-1.5997730493545532,
0.0635332465171814,
1.176804780960083,
-0.5265083312988281,
-0.26728159189224243,
-0.060308218002319336,
-1.3730781078338623,
-0.5340268611907959,
-0.532072186470031... |
javascript/reference/errors/getter_no_arguments/index.md | JavaScript - Errors - Getter no arguments - Message:
Example:
SyntaxError: Getter must not have any formal parameters. (V8-based)
SyntaxError: getter functions must have no arguments (Firefox)
SyntaxError: Unexpected identifier 'x'. getter functions must have no parameters. (Safari) | [
-1.2518017292022705,
-0.1580018401145935,
-1.8291091918945312,
-0.6323003768920898,
-1.0494014024734497,
-1.6174137592315674,
0.006971507798880339,
0.7137637138366699,
-0.23725831508636475,
-0.5627598166465759,
0.2671447694301605,
-1.0798500776290894,
-0.3916592299938202,
-0.47542101144790... |
javascript/reference/errors/getter_no_arguments/index.md | JavaScript - Errors - Getter no arguments - Error type:
`SyntaxError` | [
-0.5713873505592346,
0.2985645830631256,
-0.5590466260910034,
-0.6180365085601807,
-0.7655437588691711,
-0.9886122941970825,
0.8391826152801514,
2.7188403606414795,
0.3087773323059082,
-0.7877421975135803,
0.42539674043655396,
-0.7716440558433533,
-0.29715755581855774,
-0.28210321068763733... |
javascript/reference/errors/getter_no_arguments/index.md | JavaScript - Errors - Getter no arguments - What went wrong?:
The `get` property syntax looks like a function, but it is stricter and not all function syntax is allowed. A getter is always invoked with no arguments, so defining it with any parameter is likely an error.
Note that this error only applies to property ge... | [
-0.6835919618606567,
-0.3754688799381256,
-1.593345284461975,
0.22634267807006836,
-0.20770889520645142,
-2.1489574909210205,
-0.1972779482603073,
1.0914629697799683,
0.2409522533416748,
-0.09827230870723724,
-0.16247732937335968,
-0.3776995837688446,
-0.2547857463359833,
-0.50030255317687... |
javascript/reference/errors/getter_no_arguments/index.md | JavaScript - Errors - Getter no arguments - Examples - Invalid cases:
Example:
const obj = {
get value(type) {
return type === "string" ? String(Math.random()) : Math.random();
},
}; | [
-0.9217043519020081,
0.26050254702568054,
-0.9520853161811829,
0.03093348816037178,
-0.29947325587272644,
-0.8644559383392334,
0.7035460472106934,
1.1811656951904297,
-0.8310138583183289,
-0.015873616561293602,
-0.3195403814315796,
-0.4243641495704651,
0.17338505387306213,
-0.4820046722888... |
javascript/reference/errors/getter_no_arguments/index.md | JavaScript - Errors - Getter no arguments - Examples - Valid cases:
Example:
// Remove the parameter
const obj = {
get value() {
return Math.random();
},
};
// Use a normal method, if you need a parameter
const obj = {
getValue(type) {
return type === "string" ? String(Math.random()) : Math.random();
... | [
-0.3508642613887787,
0.3428707718849182,
-1.1653242111206055,
0.4673183858394623,
-0.11289704591035843,
-1.6092110872268677,
0.6737887859344482,
0.39290985465049744,
0.0838518738746643,
0.11373120546340942,
-0.6811014413833618,
-0.2534927427768707,
0.17451900243759155,
-0.3557587265968323,... |
javascript/reference/errors/bad_super_prop/index.md | JavaScript - Errors - Bad super prop:
The JavaScript exception "use of super property/member accesses only valid within methods or eval code within methods" occurs when the `super.x` or `super[x]` syntax is used outside of a method. | [
-0.21116508543491364,
-0.013067060150206089,
-0.9373562932014465,
0.6334262490272522,
-0.41351616382598877,
-1.4750088453292847,
0.5384979248046875,
0.8130025863647461,
-0.7360168099403381,
-0.15264487266540527,
-0.7764365673065186,
-0.29657474160194397,
0.36162489652633667,
-0.88183295726... |
javascript/reference/errors/bad_super_prop/index.md | JavaScript - Errors - Bad super prop - Message:
Example:
SyntaxError: 'super' keyword unexpected here (V8-based)
SyntaxError: use of super property accesses only valid within methods or eval code within methods (Firefox)
SyntaxError: super is not valid in this context. (Safari) | [
-0.7324253916740417,
0.15486030280590057,
-0.5993291735649109,
-0.06486181914806366,
-0.5440033078193665,
-1.4976800680160522,
0.4637046456336975,
1.4065401554107666,
-0.3843315541744232,
-0.1183236837387085,
-0.46592193841934204,
0.10644971579313278,
-0.07027281820774078,
-0.5794378519058... |
javascript/reference/errors/bad_super_prop/index.md | JavaScript - Errors - Bad super prop - Error type:
`SyntaxError` | [
-0.4508950412273407,
0.021473858505487442,
-0.5905101895332336,
-0.5184352397918701,
-0.6306808590888977,
-0.5692797303199768,
0.7627034783363342,
2.4180445671081543,
-0.7455668449401855,
-0.4107024073600769,
-0.16151347756385803,
-0.21333163976669312,
-0.03389980271458626,
0.0313227586448... |
javascript/reference/errors/bad_super_prop/index.md | JavaScript - Errors - Bad super prop - What went wrong?:
The `super.x` syntax is used to access properties on the prototype of the current object. It can be used in methods of both object literals and classes, field initializers, and static initialization blocks, but not in other contexts. | [
-0.7692338228225708,
0.36739984154701233,
-0.4154182970523834,
0.15207025408744812,
-0.5658077597618103,
-0.6459877490997314,
0.08629674464464188,
0.8820645213127136,
0.03714457526803017,
0.11130382120609283,
-0.8366069793701172,
-0.33079421520233154,
0.624557614326477,
-0.4061417877674103... |
javascript/reference/errors/bad_super_prop/index.md | JavaScript - Errors - Bad super prop - Examples - Invalid cases:
You can't use `super.x` outside of a method in an object:
Example:
const obj = {
__proto__: { x: 1 },
x: super.x, // SyntaxError: use of super property accesses only valid within methods or eval code within methods
};
You can't use `super.x` in a ... | [
-0.1486920267343521,
0.5860282182693481,
-0.7797211408615112,
0.18925505876541138,
-0.29337722063064575,
-1.590430736541748,
-0.0758141279220581,
1.142554759979248,
-0.7335354685783386,
-0.16931168735027313,
-0.5037553310394287,
0.4417112469673157,
-0.2260836660861969,
-1.0268535614013672,... |
javascript/reference/errors/bad_super_prop/index.md | JavaScript - Errors - Bad super prop - Examples - Valid cases:
You can use `super.x` in a method:
Example:
class Base {
x = 1;
}
class Derived extends Base {
getX() {
return super.x;
}
}
You can use `super.x` in a field initializer:
Example:
class Derived extends Base {
x = super.x;
}
You can use `s... | [
0.07039300352334976,
0.037642497569322586,
-1.322528600692749,
0.20842982828617096,
-0.7715679407119751,
-1.329546332359314,
0.7857411503791809,
0.790269672870636,
-0.3186649680137634,
-0.2569728493690491,
-0.5988132357597351,
0.34408503770828247,
-0.2754812240600586,
-0.7590177059173584,
... |
javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | JavaScript - Errors - Deprecated caller or arguments usage:
The JavaScript strict mode-only exception "'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them" occurs when the deprecated `arguments.callee`, `Function.prototype.caller`, or `... | [
-0.18311582505702972,
-0.09680870175361633,
-0.8663043975830078,
0.8430028557777405,
-0.40672680735588074,
-1.7385337352752686,
0.48711255192756653,
0.46038299798965454,
-0.42653143405914307,
0.22271300852298737,
-0.7212366461753845,
-0.9186551570892334,
-0.16142229735851288,
-0.3526436090... |
javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | JavaScript - Errors - Deprecated caller or arguments usage - Message:
Example:
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them (V8-based & Firefox)
TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in thi... | [
-0.013877946883440018,
0.1661023646593094,
-1.1820679903030396,
0.04186955466866493,
-0.6398184895515442,
-1.174157977104187,
0.8626985549926758,
0.8319258093833923,
-0.28001534938812256,
0.21563662588596344,
0.07209013402462006,
-0.967365562915802,
-0.0026975434739142656,
-0.3681323826313... |
javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | JavaScript - Errors - Deprecated caller or arguments usage - Error type:
`TypeError` in strict mode only. | [
-0.4613584876060486,
-0.2653597891330719,
-1.5193402767181396,
0.018464084714651108,
-0.24927452206611633,
-0.43760719895362854,
0.899125874042511,
1.4930137395858765,
0.02683452144265175,
-0.059349607676267624,
-0.5834676027297974,
-1.130104422569275,
-0.04655548930168152,
-0.253165185451... |
javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | JavaScript - Errors - Deprecated caller or arguments usage - What went wrong?:
In strict mode, the `arguments.callee`, `Function.prototype.caller`, or `Function.prototype.arguments` properties are used and shouldn't be. They are deprecated, because they leak the function caller, are non-standard, hard to optimize and ... | [
-0.4603845179080963,
-0.05838960409164429,
-1.5091909170150757,
-0.1222522109746933,
-0.2542218863964081,
-1.5290019512176514,
0.3446277678012848,
0.6111735105514526,
-0.11248770356178284,
0.4928068518638611,
-1.1929959058761597,
-0.45240098237991333,
-0.2506030201911926,
-0.44789978861808... |
javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | JavaScript - Errors - Deprecated caller or arguments usage - Examples - Deprecated function.caller or arguments.callee:
`Function.prototype.caller` and `arguments.callee` are deprecated (see the reference articles for more information).
Example:
"use strict";
function myFunc() {
if (myFunc.caller === null) {
... | [
-0.5204502940177917,
0.03703086078166962,
-1.08387291431427,
0.166764035820961,
0.14490966498851776,
-1.9111188650131226,
0.6946364045143127,
0.6807345151901245,
-0.07808814197778702,
0.696549117565155,
-0.4503314793109894,
-0.7359153032302856,
-0.7318947911262512,
-0.02629244700074196,
... |
javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | JavaScript - Errors - Deprecated caller or arguments usage - Examples - Function.prototype.arguments:
`Function.prototype.arguments` is deprecated (see the reference article for more information).
Example:
"use strict";
function f(n) {
g(n - 1);
}
function g(n) {
console.log(`before: ${g.arguments[0]}`);
if ... | [
-0.4049983024597168,
-0.30291280150413513,
-0.8167389035224915,
-0.17427828907966614,
0.3251264989376068,
-1.9854414463043213,
0.5901634097099304,
0.4503191411495209,
-0.581243634223938,
0.330223947763443,
-0.2809920907020569,
-0.5017156600952148,
-0.39194512367248535,
-0.4754350185394287,... |
javascript/reference/errors/cyclic_object_value/index.md | JavaScript - Errors - Cyclic object value:
The JavaScript exception "cyclic object value" occurs when object references were found in JSON. `JSON.stringify()` doesn't try to solve them and fails accordingly. | [
-0.8015168309211731,
-0.28844285011291504,
-1.4843413829803467,
0.5567288398742676,
-0.15082289278507233,
-1.1050078868865967,
1.0446479320526123,
0.6111865639686584,
-0.6331008076667786,
-0.33807462453842163,
0.20431144535541534,
-1.075767159461975,
0.13541656732559204,
-0.053126536309719... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.