JavaScript Academy · Lesson

Beyond console.log

Use table, group, warn, error, and assert.

Lesson 1 of 413 steps

Beyond console.log is a free JavaScript Academy lesson on CoddyKit. This is lesson 1 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the JavaScript Academy learning path, and your progress syncs across the web and the CoddyKit app. The JavaScript Academy course includes 4 lessons in total.

More Than Log

The console object offers many methods beyond console.log. Each communicates a different intent and can render output in useful ways.

console.log("plain message")
console.info("informational")

console.warn

console.warn emits a warning. In a browser it appears with a yellow highlight, signaling a non-fatal issue worth attention.

console.warn("This API is deprecated")

console.error

console.error reports an error. It is styled distinctly and, in browsers, includes a stack trace to help locate the problem.

console.error("Failed to load data")

console.info and debug

console.info and console.debug behave like log but convey severity. Tools can filter messages by these levels.

console.info("Server started")
console.debug("Cache size is 42")

console.table

console.table renders arrays and objects as a formatted table, making structured data far easier to scan than a plain log.

const users = [
  { name: "Ann", age: 30 },
  { name: "Bob", age: 25 }
]
console.table(users)

console.group

console.group starts an indented, collapsible section. Messages logged after it are nested until you call console.groupEnd.

console.group("User details")
console.log("Name: Ann")
console.log("Age: 30")
console.groupEnd()

Nested Groups

Groups can nest inside each other to mirror a hierarchy, with each level adding more indentation.

console.group("Order")
console.log("id: 1")
console.group("Items")
console.log("Book")
console.groupEnd()
console.groupEnd()

console.assert

console.assert logs an error only when its first argument is falsy. It is a quick way to flag broken assumptions without halting execution.

const total = 10
console.assert(total > 0, "total should be positive")
console.assert(total > 100, "total is unexpectedly small")

console.count

console.count tracks how many times a labeled line has run, which is handy for spotting unexpected repeated calls.

function ping() {
  console.count("ping")
}
ping()
ping()
ping()

console.time

console.time and console.timeEnd measure how long a block of code takes, printing the elapsed duration with a matching label.

console.time("loop")
let sum = 0
for (let i = 0; i < 1000; i++) { sum += i }
console.timeEnd("loop")

Choosing the Right Method

Use warn and error for problems, table for structured data, group to organize related logs, and assert to validate assumptions. Clear logging speeds up debugging.

console.warn("low memory")
console.table([{ id: 1 }, { id: 2 }])

Quick Check

Test your console method knowledge.

Recap

Recap: The console has rich methods beyond log.

  • warn and error signal severity
  • table renders structured data
  • group organizes nested logs
  • assert flags failed conditions
console.table([{ a: 1 }, { a: 2 }])
console.warn("done")
Free to start

Learn JavaScript with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
59
Lessons
200

Frequently Asked Questions

Is the “Beyond console.log” lesson free?

Yes — any 3 lessons of the JavaScript Academy learning path, including “Beyond console.log”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The JavaScript Academy course includes 4 lessons in total.

What will I learn in “Beyond console.log”?

Use table, group, warn, error, and assert. You practise JavaScript Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start JavaScript Academy?

No prior experience is required. JavaScript Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

How long does the “Beyond console.log” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this JavaScript Academy lesson?

Yes. Every JavaScript Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Beyond console.log
  2. Setting Breakpoints
  3. Stepping Through Code
  4. Reading Stack Traces
← Back to JavaScript Academy