웹 콘솔에 에러 메시지를 출력합니다.
주의: 이 기능은 Web Worker에서 사용할 수 있습니다.
문법
console.error(obj1 [, obj2, ..., objN]); console.error(msg [, subst1, ..., substN]); console.exception(obj1 [, obj2, ..., objN]); console.exception(msg [, subst1, ..., substN]);
노트: console.exception()
은 console.error()
의 별칭입니다. 둘은 기능적으로 동일합니다.
파라미터
obj1
...objN
- 출력할 JavaScript 객체의 리스트. 각 객체의 문자열 표현은 나열된 순서로 함께 출력됩니다.
msg
- 0개 이상의 하위 문자열을 포함하는 JavaScript 문자열.
subst1
...substN
msg
안의 대체할 하위 문자열을 포함하는 JavaScript 객체. 출력 형식에 추가 제어를 할 수 있게 해줍니다.
자세한 내용은 console
문서의 콘솔에 텍스트를 출력하기를 확인하세요.
명세
Specification | Status | Comment |
---|---|---|
Console API The definition of 'console.error()' in that specification. |
Living Standard | 초기 정의 |
브라우저 호환성
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.