console.error()
console.error() is a JavaScript method in the Console category. Outputs an error message. The syntax is console.error(value1, ..., valueN). A typical example: console.error("Something went wrong"). A close sibling is console.log(), which outputs a message to the console. A close sibling is console.warn(), which outputs a warning message. A close sibling is console.info(), which outputs an informational message. A close sibling is console.debug(), which outputs a debug message. More about this category: Console methods for debugging — log, error, table, time, and more. Related Console methods: console.log(), console.warn(), console.info(), console.debug(), console.table(), console.group(), console.groupCollapsed(), console.groupEnd(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try console.error() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.