Practice ยท 3 of 3
Cleanup With finally
Write async function withLock(lock, job) where lock has acquire() and release() (both promise-returning). Acquire, run job(), and ALWAYS release โ whether the job succeeded or threw. RETURN the job's result; if the job threw, rethrow after releasing.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Promises โ Practice