function multiplyByTwo(num){
return Promise.resolve(num + 1 * 2);
}
/* addOne(1)
.then(num => addOne(num)) // 2 → 3
.then(num => addOne(num)) // 3 → 4
.then(result => console.log(result)); // 4 */
multiplyByTwo(1)
.then(num => multiplyByTwo(num))
.then(num => multiplyByTwo(num))
.then(reuslt => console.log(reuslt));
Code will run automatically after changes.
Code runs in an isolated environment.
Code runs in an isolated environment.