[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/TypeError [Back]  [Original]

TypeError - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

TypeError

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

* Some parts of this feature may have varying levels of support.

TypeError , , , ( ), .

TypeError :

  • , , ;
  • , ;
  • .

TypeError , structuredClone() postMessage().

TypeError Error.

In this article

TypeError()

TypeError.

Error.

TypeError.prototype TypeError.

TypeError.prototype.constructor

-, . TypeError TypeError.

TypeError.prototype.name

. TypeError.prototype.name "TypeError".

Error.

TypeError

js
try {
  null.f();
} catch (e) {
  console.log(e instanceof TypeError); // true
  console.log(e.message); // "null has no properties"
  console.log(e.name); // "TypeError"
  console.log(e.stack); //  
}

TypeError

js
try {
  throw new TypeError("");
} catch (e) {
  console.log(e instanceof TypeError); // true
  console.log(e.message); // ""
  console.log(e.name); // "TypeError"
  console.log(e.stack); //  
}

Specification
ECMAScript 2027 LanguageSpecification
# sec-native-error-types-used-in-this-standard-typeerror


Web Proxy Viewer  |  New URL  |  Original Page