
APIs can be slow or hang forever. Let's implement a timeout that cancels the request if it takes too long using Promise.race().
withTimeout(promise, ms) function"Request timed out"Promise.race() for the racing logicSubmit your code to see test results