console.error()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

console.error() 메서드는 웹 콘솔에 에러 메시지를 출력합니다.

참고 : 이 기능은 Web Worker에서 사용할 수 있습니다.

구문

js
console.error(obj1 [, obj2, ..., objN]);
console.error(msg [, subst1, ..., substN]);

매개변수

obj1 ... objN

출력할 JavaScript 객체의 리스트. 각 객체의 문자열 표현은 나열된 순서로 함께 출력됩니다.

msg

0개 이상의 하위 문자열을 포함하는 JavaScript 문자열.

subst1 ... substN

msg 안의 대체할 하위 문자열을 포함하는 JavaScript 객체. 출력 형식에 추가 제어를 할 수 있게 해줍니다.

자세한 내용은 콘솔에 텍스트 출력하기를 확인하세요.

명세

Specification
Console
# error

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
error() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support