I need to pass a variable through a promise .then
chain. I can't find a way to work it out. I'm quite new to this so bear with me!
return foo.bar(baz)
.then((firstResult) => {
let message = firstResult;
})
.then(() => foo.bar(qux)
.then((secondResult) => {
message =+ secondResult;
console.log(message);
})
)
What's the correct way of doing this please?