console.log() vs console.error()
console.log() and console.error() are both JavaScript Console APIs, and choosing between them is a common point of confusion. This page compares their syntax, parameters, return values, and typical use cases so you can pick the right one. console.log(): Outputs a message to the console. Its syntax is console.log(value1, ..., valueN). console.error(): Outputs an error message. Its syntax is console.error(value1, ..., valueN). Example of console.log(): console.log("Hello, World!"). Example of console.error(): console.error("Something went wrong"). Read the full references for console.log() and console.error() to see edge cases, time complexity, browser support, and the mistakes developers most often make with each. Other Console APIs worth comparing: console.warn(), console.info(), console.debug(), console.table(), console.group(), console.groupCollapsed(). Both belong to the Console category in the JS Reference documentation, which covers 23 entries in total. Try both in the JavaScript playground to see the behavioral difference live.