Skip to content

Tag: es6-promise

Why are promise function in executing in wrong order?

When I am executing separately that program gives the right solution but when I run all four it got messup. Expected Output: Getting username… Username = srishti Validating username… Valid Username! Getting password… Password = upgrad Validating password… Valid Password! BOTH VALID****…

Function recursion advice

I am building an employee tracking app. I want my app to work so that after each one of the functions for the various list selections is complete, the app will re-prompt you with the options list again. There are a few methods I can think of to achieve this but I was hoping a more seasoned developer could rec…

Calculate Value from JS Promise

I have assigned a callback function to a variable. The function then returns a promise stating it is fulfilled and the value. I want to be able to return the value and use it to perform a mathematical calculation. Javascript code: In the console I get the below output. Answer Assuming this is the interface yo…