Skip to main content
๐Ÿ› Bug HuntJS JavaScript Hard+35 XP

Async Await Missing

This function should wait for data but returns a Promise instead.

๐Ÿ› Find the bug
1async function getData(url) {
2 const response = fetch(url);
3 const data = response.json();
4 return data;
5}
๐Ÿ› The bug is on line 2

๐Ÿ”ง Select the correct fix:

Priygop - Leading Professional Development Platform | Expert Courses & Interview Prep