Create a `retry` function, that takes 2 arguments:
- a `count` indicates maximum amount of retries
- `count`: indicates maximum number of retries.
- an async `callback`, that will be called on every try
- `callback`: an `async` function that will be invoked for every attempt.
`retry` returns a function that calls and returns value from `callback`
`retry` returns a function that invokes the `callback` function. That function passes its arguments to `callback`, and returns the value from `callback`.
function passing its arguments and catches errors. If error is caught it
should return the `callback` function with catch. If number of errors
exceeds `count` then throw an `Error`.
> for count of 3, the function will be called at most 4 times:
The function returned by `retry` must `catch` errors from `callback`. After that function has caught `count` errors, it must `throw` an `Error`.
> the initial call + 3 retries.
Create a `timeout` function, that takes 2 arguments
> if `count` is 3, `callback` will be invoked at most 4 times, the initial call plus 3 retries.
- a `delay` indicates maximum wait time
Create function named `timeout`, that takes 2 arguments:
- an async `callback`, that will be called
`timeout` returns a function either that calls and returns value from `callback`
- `delay`: indicates maximum wait time.
function passing its arguments or returns `Error('timeout')` if `callback` didn't
- `callback`: an asynchronous function that will be invoked.
resolve before `delay` time has reached.
`timeout` returns a function that invokes and returns the value from `callback`. The function must pass its arguments to `callback`. If `callback` does not resolve before `delay`, your function returns `Error('timeout')`.