How to Use the Console in #chromedevtools (Find Errors, Filter, Test) #shorts #javascript

Nov 30, 2026

How to use the Console in Chrome DevTools in 3 steps: read the error and jump to its line, filter out the noise, and test values in the live JavaScript prompt.

See the errors your users hit, not just you: Bugfender collects their logs. Start for free: https://bugfender.com/

The Console shows your page's logs, warnings and errors, and it's also a live JavaScript prompt for the page you're on.

STEPS Open the Console: Command+Option+J on a Mac, Control+Shift+J on Windows or Linux. Read the red lines first. Each error shows the file and line it came from (here app.js:12). Click that link to open the exact line in the Sources panel. Too much noise? Open the levels menu (Default levels) and keep only Errors. Or type in Filter to show only the messages that match, for example cart. Use the prompt at the bottom: type a JavaScript expression and press Enter. In the video:
cart.items.length
2
cart.items[2]
undefined Read what it means: the cart has 2 items (index 0 and 1), so cart.items[2] doesn't exist. The loop in checkout() used i less-than-or-equal-to cart.items.length, one step too far. The fix is i less-than cart.items.length.

THE ERROR FROM THE VIDEO
Uncaught TypeError: Cannot read properties of undefined (reading 'name') at HTMLButtonElement.checkout (app.js:12:30)

MORE CONSOLE TIPS

  • Clear the Console: Command+K on a Mac, Control+L on Windows, or type clear().
  • Preserve log (Console settings, the gear): keep messages after a reload or a redirect.
  • Live Expressions (the eye icon): pin an expression to the top and watch its value change.
  • console.log is Info level and console.error is Error level, so the levels menu filters your own logs too.
  • The Filter box accepts text or a regular expression, and url: to show messages from one script.

COMMON MISTAKES

  • Reading only the last error: the first red line is usually the cause, the rest follow from it.
  • Hiding Info and forgetting: your console.log lines vanish until you tick Info again.
  • Guessing a value: type it in the prompt instead and see what it really is.
  • Losing the error on reload: turn on Preserve log before you reproduce the bug.

WHAT'S ON SCREEN

  • The Console with a log, an info line, a warning and the TypeError
  • The app.js:12 link opened in Sources, line 12 marked
  • The levels menu, then Errors only (3 hidden)
  • Filter set to cart
  • The prompt: cart.items.length returns 2, cart.items[2] returns undefined
  • The loop in Sources that goes one step too far

FAQ
Why don't I see my console.log messages?
Check the levels menu: if only Errors is ticked, Info messages (console.log) are hidden. Also clear the Filter box.

What does Cannot read properties of undefined (reading 'name') mean?
Something before.name is undefined. Type that part in the Console (here cart.items[2]) to see which value is missing.

How do I keep the logs after the page reloads?
Turn on Preserve log in the Console settings.

Can I open the Console without the shortcut?
Yes: right-click the page, choose Inspect, then click the Console tab. Pressing Escape in any other DevTools panel also opens the Console as a drawer at the bottom.

ABOUT THIS VIDEO
Brewly is a fictional demo cart page with one real bug (an off-by-one loop). Every DevTools screen is a real capture of Chrome DevTools on that page, shown in a narrow window so it reads on a phone. The keyboard card and the browsers graphic are illustrations. The narration is an AI voice.

The Console only shows what happens in your own browser. Bugfender collects your web app's logs and errors from your users' browsers and devices, so you can read the same errors when they happen to someone else. Over 35,000 apps trust Bugfender.
Get started for free: https://bugfender.com

RELATED VIDEOS
"How to Fix a CORS Error"
"How to Use the Network Tab in Chrome DevTools"

LINKS
Console overview: https://developer.chrome.com/docs/devtools/console
Console features reference: https://developer.chrome.com/docs/devtools/console/reference
Live Expressions: https://developer.chrome.com/docs/devtools/console/live-expressions
Bugfender for JavaScript: https://bugfender.com/platforms/javascript/
Bugfender: https://bugfender.com