Great article!. I have to point that it wasn't required the creation of the promise at first, because fetch already returns a Promise. You could go even further:
const fetch_retry = (url, options, n) => fetch(url, options).catch(error => n===1? Promise.reject(error) : fetch_retry(url, options, n-1));
Arihant
Non sticky pan to events 🥘🍳
We as developers need this style more to share knowledge. It's very difficult to read code and track back how the developer would have made mistakes then cleaned and corrected code to the one which we read. This is why live coding and articles like these are, I'd say, desperately needed. Thank you for writing this Jason Yu!