DEV Community

Rafi
Rafi

Posted on

Top level await in Dev tools

Many times when you are writing code you may want to do a simple fetch request and see the response. Doing this is quite annoying from dev tools (because fetch API returns promise which you then have to resolve to get response). Fortunately for us Chrome dev tools support top level await without needing async function. Meaning you can do this

> const response = await fetch('https://jsonplaceholder.typicode.com/todos/1')
> await response.json()
💬 ชาวเน็ตแห่แชร์: rafi/top level await in dev tools l - Kapook Update 2025 💬 ชาวเน็ตแห่แชร์: rafi/top level await in dev tools l - Kapook Update 2025

Alt Text

Top comments (1)

💬 ชาวเน็ตแห่แชร์: rafi/top level await in dev tools l - Kapook Update 2025
 
prameshbajra profile image
Pramesh Bajracharya •

Always learning something from you.
Good one. Thanks.