Rest API - Webhooks and Events
What is the bug in this JavaScript async retry function for fetching data?
async function fetchData() {
let tries = 0;
while (tries < 3) {
try {
const response = await fetch('https://api.example.com');
if (response.ok) return 'Success';
} catch (error) {
// error handling
}
}
}