How to useconsole.warn() Method in Javascript
The console.warn() method is used to write a warning message in the console. To check the warning message, open the console panel to display the output (warning message).
Syntax:
console.warn( message )
Example:
Javascript
let str = [ "Welcome to w3wiki" ]; console.warn(str); |
Output:
Welcome to w3wiki
How to Print a Message to the Error Console Using JavaScript ?
This article will show you how to print a message using JavaScript on the error console. There are three methods to display the error console, these are:
Table of Content
- Using console.error() Method
- Using console.warn() Method
- Using console.info() Method