Skip to content

console.error()

Description

The console.error() method outputs an error message in red color to the console, each message is marked with an error icon. It's used for indicating critical issues that require immediate attention. It can take several arguments and display them on one line.

Syntax

JS
console.error(message1: any, message2: any, messageN: any) -> void

Parameters

Parameter Type Description
message1 any Text of the message.
message2 any Text of the message.
messageN any Text of the message.

Return value

Type Description
void An empty value.

Example

JS
1
2
3
4
5
6
7
8
9
// One argument
console.error('critical text')

// Several arguments
console.error('text1', 'text2')
console.error('text1', 'text2', .. , 'text10')

// Different types of arguments
console.error('text1', 123, true, { key: 'value''})
Last update: 14 August 2025, 18:47