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

TypeError - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

TypeError

Baseline *

20157

*

TypeError

TypeError

TypeError structuredClone() postMessage()

TypeError Error

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("Hello");
} catch (e) {
  console.log(e instanceof TypeError); // true
  console.log(e.message); // "Hello"
  console.log(e.name); // "TypeError"
  console.log(e.stack); // 
}

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


Web Proxy Viewer  |  New URL  |  Original Page