Error types (TypeError, ReferenceError)
Në shqip: Llojet e gabimeve në JS
ShpjegimiSQ
Gabimet më të shpeshta në JS: ReferenceError (përdor një variabël që s'ekziston), TypeError (p.sh. „x is not a function“ ose lexon një veti nga undefined), SyntaxError (kod i shkruar gabim) dhe RangeError (vlerë jashtë kufijve).
EnglishEN
The most common JS errors: ReferenceError (using a variable that doesn't exist), TypeError (e.g. “x is not a function” or reading a property of undefined), SyntaxError (badly written code) and RangeError (a value out of range).
Si ta mendosh
Si dritat e ndryshme në panelin e veturës: secila të tregon një problem tjetër.
Lexoje në anglisht
Like the different warning lights on a car dashboard: each points to a different problem.
Shembull kodijavascript
emri; // ReferenceError: emri is not defined
undefined.gjatesia; // TypeError: Cannot read properties of undefined
(5).toUpperCase(); // TypeError: ... is not a function