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

Error() - 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

Error()

Baseline Widely available

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

Error .

In this article

js
new Error();
new Error(message);
new Error(message, fileName);
new Error(message, fileName, lineNumber);

message Optional

.

fileName Optional

Error fileName . Error() .

lineNumber Optional

Error lineNumber . Error() .

Error new Error . Error new .

js
//  ...
const x = Error("  !");

// ...     
const y = new Error('"new"   !');

Specification
ECMAScript 2027 LanguageSpecification
# sec-error-constructor


Web Proxy Viewer  |  New URL  |  Original Page