Complete the code to add a handler that logs the resolved value of the promise.
Promise.resolve('Hello').[1](value => console.log(value));
The then method is used to handle the resolved value of a promise.
Complete the code to chain a second then that doubles the number.
Promise.resolve(5).then(num => num).[1](num => num * 2);
To chain operations on promises, use then again.
Fix the error in the code by completing the blank with the correct method to catch errors.
Promise.reject('Error occurred').[1](error => console.log(error));
The catch method handles rejected promises (errors).
Fill both blanks to create a promise chain that adds 3 then multiplies by 2.
Promise.resolve(4).[1](num => num + 3).[2](num => num * 2);
Both steps use then to process the resolved value sequentially.
Fill all three blanks to chain promises that fetch data, parse JSON, and log the result.
fetch('url').[1](response => response.[2]()).[3](data => console.log(data));
Use then to handle promises, json() to parse response, and another then to log data.
