Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
* Some parts of this feature may have varying levels of support.
TypeError オブジェクトは、演算が実行できなくなった時の新しいエラーを表します。特に値が期待された型ではなかった場合です(ただし、それに限りません)。
TypeError は以下のような場合に発生します。
TypeError はシリアライズ可能オブジェクトであり、structuredClone() で複製したり、ワーカー間で postMessage() を用いてコピーしたりすることができます。
TypeError は Error のサブクラスです。
新しい TypeError オブジェクトを生成します。
親である Error から継承したインスタンスプロパティもあります。
これらのプロパティは TypeError.prototype に定義されており、すべての TypeError インスタンスで共有されます。
TypeError.prototype.constructorこのインスタンスオブジェクトを作成したコンストラクター関数です。TypeError インスタンスの場合、初期値は TypeError コンストラクターです。
TypeError.prototype.nameエラーの型の名前を表します。TypeError.prototype.name の場合、初期値は "TypeError" です。
親である Error から継承したインスタンスメソッドもあります。
| ECMAScript® 2027 Language Specification # sec-native-error-types-used-in-this-standard-typeerror |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2026年3月17日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.