Difficulty: 4/10promise chaining, async/await, error handlingYou can use the .then() method on a Promise to handle its successful resolution and use the .catch() method to handle errors.javascriptCopyScenario Questions0-2 years experience1You need to fetch user data with fetch() and then display the name. How would you handle the promise result to update the UI?2If the API call fails, what code would you write to show an error message to the user?2-5 years experience1We have a function that calls two APIs sequentially, each returning a promise. How would you structure the code so the second call only runs after the first resolves, and handle any errors that might occur in either step?Follow-up QuestionsWhat difference does returning a value vs. returning a promise inside a then callback make?How would you surface an error from deep inside a promise chain to the top level?When would you prefer async/await over explicit then/catch chaining?Suggest Improvement