Practice ยท 3 of 3
Retry on Failure
Write withRetry(task, retries). task is a zero-argument function. Call it; if it throws, call it again โ up to retries additional attempts. RETURN the first successful result. If every attempt fails, rethrow the LAST error.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Error Handling โ Practice