Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
TypeError 생성자는 객체는 일반적으로 값이 기대하던 자료형이 아니라서 연산을 할 수 없을 때 발생하는 오류를 생성합니다.
참고 : TypeError() new를 사용하거나 혹은 사용하지 않고 호출이 사용합니다. 두 방법 모두 새로운 TypeError를 생성합니다.
사람이 읽을 수 있는 오류에 대한 설명
options Optional다음의 속성을 가지는 객체.
cause Optional오류의 특정 원인을 가리키는 속성. 오류를 잡아서 좀 더 상세하거나 유용한 오류 메시지와 함께 예외를 다시 발생시킬 때 이 속성을 원래 오류를 전달하는데 사용할 수 있습니다.
fileName Optional예외가 발생한 코드를 담고 있는 파일 이름
lineNumber Optional예외가 발상한 코드의 줄 수
| ECMAScript® 2027 Language Specification # sec-nativeerror-constructors |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 10월 9일 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.