The console object is your first debugging toolkit in JavaScript. This hub links to 14 method and 1 property tutorials covering logging, grouped output, tables, timers, assertions, stack traces, and heap stats.
01
log()
General output
02
warn / error
Severity levels
03
table()
Tabular data
04
group()
Nested logs
05
time()
Performance
06
15 guides
Full index
Fundamentals
Introduction
JavaScript console methods help you inspect values, trace bugs, and understand program flow during development. In the browser, open DevTools with F12 or Ctrl+Shift+I (Windows) / Cmd+Option+I (Mac), then switch to the Console tab to see output.
What Are Console Methods?
They are functions on the global console object. Each method formats output differently—some add icons or colors, others build tables or measure elapsed time. They are meant for developers, not end users; strip or guard verbose logging before shipping to production.
💡
Beginner Tip
Start with console.log() to print variables. When something looks wrong, add console.warn() or console.error() so important messages stand out in DevTools.
Browser vs Node.js
Browser — logs appear in DevTools with clickable links to source lines.
Node.js — logs print to the terminal; most core methods behave similarly.
Production — prefer structured logging libraries or feature flags instead of raw console.log everywhere.
What Are Console Properties?
Unlike methods, properties are values you read directly on console without calling them. The most common example is console.memory in Chromium browsers, which exposes JavaScript heap usage (usedJSHeapSize, totalJSHeapSize, jsHeapSizeLimit). Properties are read-only snapshots—use methods like console.log(console.memory) to inspect them.
Foundation
📝 Syntax
Call any method on the console object:
JavaScript
console.log("Hello, debugger!");
console.warn("Low disk space");
console.error("Request failed", statusCode);
Method groups
Category
Methods
Purpose
Logging
log, info, warn, error
Print messages at different severity levels
Structure
group, groupEnd, table
Organize complex output
Diagnostics
assert, trace, count
Validate and measure behavior
Timing
time, timeEnd
Benchmark code blocks
Utility
clear
Reset the console view
Properties
memory
Read heap stats (Chrome; not a method call)
Cheat Sheet
⚡ Quick Reference
Goal
Method
Print a value
console.log(value)
Highlight a warning
console.warn(message)
Report an error
console.error(message)
Show objects as a table
console.table(data)
Measure duration
time(label) + timeEnd(label)
Log only if false
console.assert(condition, msg)
Context
When to Use Which Methods
Quick inspection — console.log() for variables and intermediate results.
User-visible issues — console.warn() for recoverable problems.
Failures — console.error() inside catch blocks or API error handlers.
Lists of records — console.table() for arrays of objects.
Multi-step flows — group() / groupEnd() for auth, fetch, or render pipelines.
Performance checks — time() / timeEnd() around slow functions.
Preview
👀 Console Output Preview
How different methods typically appear in DevTools:
Hello, debugger!
⚠ Warning: cache miss
✗ Error: HTTP 404
Console Tutorial Index
Search by method, property, or keyword. Methods and properties are grouped below. Each tutorial covers syntax, examples, and DevTools tips.
Methods — Getting Started
4 tutorials
Essential logging methods every developer uses daily.
The label string must match between time() and timeEnd(). For modern browsers, console.timeLog() can print intermediate marks.
Tips
💬 Usage Tips
Conditional logs — console.assert(condition, msg) logs only when condition is false.
Clear clutter — run console.clear() between test runs.
Count loops — console.count("label") shows how often a line executes.
Find callers — console.trace() prints the call stack at that moment.
Search this index — jump to any of 15 tutorials above.
Watch Out
⚠️ Common Pitfalls
Logging objects by reference — expanding an object later may show its final state, not the state at log time. Clone or log primitives when timing matters.
Leaving logs in production — exposes internals and can slow down apps; use build tools to strip logs.
Forgetting groupEnd() — unmatched groups make the console tree hard to read.
Mismatched time labels — timeEnd("a") will not stop time("b").
assert() confusion — it logs when the condition is false, unlike an if guard.
🧠 How Console Methods Work
1
Your code calls console
JavaScript invokes console.method(args) during execution.
Call
2
Runtime formats output
The browser or Node.js serializes values, adds icons, tables, or timers.
Format
3
DevTools displays it
Messages appear with source links so you can jump to the logging line.
Display
=
🔍
Faster debugging
You inspect state without altering program logic or adding UI.
Compatibility
Browser Support
Core methods like log(), warn(), error(), and clear() work in all modern browsers and Node.js. table() and grouping APIs are widely supported in current DevTools.
✓ Baseline · DevTools API
console.* methods
Supported in Chrome, Firefox, Safari, Edge, and Node.js for local development. Styling and minor behavior may vary between runtimes.
99%Core methods
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
Console methodsExcellent
Bottom line: Safe for debugging in every modern environment. Remove or gate verbose logs before production; console.memory is Chrome-only.
Wrap Up
🎉 Conclusion
Console methods are essential for learning JavaScript and fixing bugs quickly. Master log(), severity levels, grouping, and tables first, then explore timing and assertions.
Use the searchable index to open all 15 tutorials. Each page includes syntax, try-it examples, and DevTools tips.
console is a built-in object for logging and debugging. In browsers it writes to DevTools; in Node.js it writes to the terminal. It is not part of the language spec for user-facing apps — remove or gate logs in production.
In most browsers both print a message. info() may show an info icon in DevTools. Functionally they are similar; use warn() or error() when severity matters.
Use console.table() when you want to inspect arrays of objects or key-value data in column form. It is faster to scan than a long series of log() calls.
console.time(label) starts a timer. console.timeEnd(label) stops it and logs elapsed time in milliseconds. Use the same label string for both calls.
Yes. Node.js implements the console object. console.log, console.error, console.table, and most browser methods work in Node, though styling may differ.
Read the overview, open DevTools (F12), try the five examples, then open console.log() from Getting Started. Use the search box to find any of the 14 method tutorials.
Did you know?
In DevTools you can pass format specifiers to console.log like %s (string), %d (number), and %o (object) for styled, structured output—similar to printf in other languages.