Search
⌘K

Leetcode 2776. Convert Callback Based Function to Promise Based Function

Write a wrapper that converts a Node-style callback function (error-first callback as the last argument) into a Promise-returning function: call the original with any given args, preserve this binding, and resolve or reject the Promise based on the callback (handling multiple callback results appropriately).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.