Write retry(fn, times) that calls the async function fn and, if it rejects, retries up to times additional attempts before giving up.
fn's value on the first success.times is the number of RETRIES (so total attempts = times + 1).Signature: retry(fn, times) => Promise<any>
Loop up to times + 1 times; await fn() inside a try/catch.
On success, return the value immediately.
Keep the last error and throw it after the loop.
Test natijalarini ko'rish uchun kodingizni ishga tushiring.