Settle a promise by returning a tuple of the resolved value or rejected error. This function never rejects.
Time complexity: O(1)
Space complexity: O(1)
The promise to settle
A tuple of the resolved value or rejected error
Promise
const [value, error] = await settled(promise); Copy
const [value, error] = await settled(promise);
Settle a promise by returning a tuple of the resolved value or rejected error. This function never rejects.
Time complexity: O(1)
Space complexity: O(1)