console.warn()

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.warn() 메서드는 웹 콘솔에 경고 메시지를 출력합니다.

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

참고 : Firefox에서는 웹 콘솔의 경고 옆에 작은 느낌표 아이콘이 나타납니다.

구문

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

매개변수

obj1 ... objN

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

msg

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

subst1 ... substN

msg 안의 문자열을 치환하기 위한 JavaScript 객체. 출력 형식에 추가 제어를 할 수 있게 해줍니다.

자세한 내용은 console 문서의 콘솔에 텍스트 출력하기를 참고하세요.

명세

Specification
Console
# warn

브라우저 호환성

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
warn() static method

Legend

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

Full support
Full support
See implementation notes.

같이 보기