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월.
Error 생성자는 오류 객체를 생성합니다.
사람이 읽을 수 있는 오류 메시지입니다.
fileName Optional생성할 Error 객체의 fileName 속성으로 설정할 값입니다. 기본 값은 Error() 생성자를 호출한 파일의 이름입니다.
lineNumber Optional생성할 Error 객체의 lineNumber 속성으로 설정할 값입니다. 기본 값은 Error() 생성자를 호출한 줄의 번호입니다.
Error를 new 없이 함수로써 호출한 경우에도 Error 객체를 반환합니다. 따라서 단순히 Error를 호출하기만 해도 new 키워드를 사용한 것과 같은 결과를 낳습니다.
| ECMAScript® 2027 Language Specification # sec-error-constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023년 8월 8일 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.