To debug JavaScript in Chrome, open DevTools, select Sources, set a breakpoint in the relevant script, and reproduce the problem. When execution pauses, inspect values in Scope and Watch, check the Call Stack, and step through the code to see what happens. Chrome DevTools is built into Chrome; you do not need a separate debugger product.
Open Sources and find the code
Open Chrome DevTools and select the Sources panel. It contains a file tree, a code editor, and debugger controls. Locate the script that appears to handle the behavior you want to investigate. The precise pane arrangement can vary with the DevTools window width.
The Chrome DevTools documentation describes Sources as the place to debug JavaScript: Debug JavaScript.
Set a breakpoint and reproduce the problem
- In Sources, open the relevant script.
- Click the line number beside the statement where you want execution to stop. A breakpoint should appear on that line.
- Return to the page and repeat the action that triggers the behavior.
- When execution reaches the breakpoint, Chrome pauses and highlights the current line.
A line breakpoint is most useful when you have a reasonable idea which statement is involved. If the trigger is clearer than the code location, use an event, DOM-change, or exception breakpoint instead.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Inspect state while execution is paused
Scope: values available at this point
Use Scope to inspect values available to the paused code, including local, closure, and global properties. These values reflect the selected call frame, so selecting a different frame in the Call Stack can show a different scope.
Watch: expressions you want to track
Add valid JavaScript expressions to Watch when you want to follow particular values while stepping. Watch expressions refresh as execution advances. This is useful for checking whether a value changes before or after a particular statement.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Console: test an expression in the paused context
The Console can evaluate expressions while execution is paused. Use it to inspect a value or test a focused expression against the current context. Evaluation can affect page state if the expression has side effects, so prefer read-only expressions unless changing state is intentional.
Step through the code and trace the call path
- Step into enters a function called by the current statement, letting you inspect its execution.
- Step over runs the current call without entering it, which is useful when that function is not the focus.
- Step out finishes the current function and returns to its caller.
- Resume continues execution until another breakpoint or pause condition is reached.
- Continue to here runs execution to a selected later line in the current function, handy when the intervening statements are not relevant.
Read the Call Stack to see which functions led to the pause. Select a frame to inspect its call site and associated scope. Async frames may appear when the framework supports async stack tagging; their availability is not guaranteed for every application.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Choose a breakpoint for the kind of failure
| Breakpoint type | Use it when | What it reveals |
|---|---|---|
| Line breakpoint | You suspect a particular statement or section of a script. | Execution stops when it reaches the selected line. |
| Event-listener breakpoint | A browser or interface event, such as a user interaction, appears to trigger the bug. | Execution pauses when a selected event handler runs. |
| DOM-change breakpoint | You know which node is changing but not which code changes it. | Execution pauses when the selected node, its attributes, or its children change. |
| Exception breakpoint | You need to find where an error is thrown. | Execution can pause on caught or uncaught exceptions, depending on the selected option. The documented page notes a Node.js limitation for caught exceptions. |
| Function breakpoint | You want to stop whenever an in-scope function is called. | Enter debug(functionName) in the Console to pause on calls to that function. |
Pick the stopping point that best matches the clue you have: code location, event, node mutation, exception, or function call. Once paused, step into only the calls relevant to the issue and step over unrelated ones.
Debug bundled or minified code with source maps
Chrome runs the deployed JavaScript, which may be bundled or minified. If the build generates source maps and the server makes them available, DevTools can map the deployed code back to authored files. Breakpoints, errors, and logs can then point to those authored files rather than only the transformed output.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
If authored files do not appear, check that source maps are generated by the build and can be loaded from the server. Without usable maps, DevTools cannot show the original source through this mapping workflow.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common debugger problems and fixes
- The breakpoint never pauses: Confirm the page action actually runs the script and reaches that line. If you are looking at bundled output, check whether source maps are available and whether you set the breakpoint in the code that is executing.
- The file is difficult to read: Check for source maps from the build and verify the server serves them. Otherwise, you may be viewing deployed bundled or minified code.
- Scope shows unexpected values: Confirm you selected the intended Call Stack frame. Scope displays values available to that frame, not necessarily the frame you were inspecting previously.
- A DOM-change breakpoint does not stop where expected: Verify that the selected node is the one being mutated and that the chosen breakpoint covers the relevant change, such as attributes or children.
- An exception breakpoint does not catch the case you expect: Check whether the exception is caught or uncaught and which exception option is enabled. The documented guide identifies a Node.js limitation for caught exceptions.
- Async history is missing: Async stack visibility can depend on framework support for async stack tagging; the full history may not be available.
- You cannot edit a paused function live: Live editing has restrictions. The function must meet DevTools’ Call Stack requirements, including being the top-most function; recursive calls and some function types also have limits. Use normal source changes for durable fixes.
DevTools labels and keyboard shortcuts can vary by version and platform. When a shortcut or control is not where expected, use the current interface labels rather than relying on a shortcut from another setup.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Or skip the browser setup
For a website screenshot, ScreenshotNeo offers a single GET request rather than a manual browser-capture workflow. Replace the example URL with the page you need and include your API key. See the ScreenshotNeo API documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server includes tools for AI agents to take screenshots, get page information, and capture PDFs. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

