Javascript - Transform a promise value - How to solve?
Anonymous User
740

Javascript - Transform a resolved promise value

Question:

Please transform an object coming from an asynchronous source(Promise) into a formatted string value. The formatted string value must also be returned asynchronously.

Solution:

// Complete the 'resolveFormattedBalance' function below.
function resolveFormattedBalance(promise) {

}
function main(data) {
    resolveFormattedBalance(Promise.resolve(data))
        .then((formattedBalance) => {
            // This prints the OUTPUT read by Hackerrank
            console.log(formattedBalance)
        })
}

This is a very different problem. How to solve it?

Comments (1)