Interview Q&A / JavaScript

INTERVIEW Q&A · 71 QUESTIONS

JavaScript interview questions

Closures, the event loop, this, promises and the core language questions every frontend round asks.

  1. What is the difference between promises and async/await, and how do you handle errors with each?

    async/await is cleaner syntax built on top of promises. An async function always returns a promise, and await pauses that function until a promise settles. With promises you handle errors using .catch(); with async/await you use try/catch around the await.

    BeginnerIn-depth3 min read