
Modern JavaScript (ES6+)
Promises, async/await, modules, classes, map/filter/reduce, optional chaining, nullish coalescing
1What is a Promise in JavaScript?
What is a Promise in JavaScript?
Answer
A Promise is an object representing the eventual completion or failure of an asynchronous operation. It allows handling operations that take time (HTTP requests, file reads) without blocking code execution. A Promise can have three states: pending (waiting), fulfilled (successfully resolved), or rejected (failed with an error).
2What is the purpose of the async keyword before a function?
What is the purpose of the async keyword before a function?
Answer
The async keyword automatically transforms a function into an asynchronous function that always returns a Promise. Even if the function returns a simple value, it will be automatically wrapped in a resolved Promise. This allows using await inside the function to wait for other Promises in a more readable way than with then() and catch().
3What does the optional chaining operator ?. do in JavaScript?
What does the optional chaining operator ?. do in JavaScript?
Answer
The optional chaining operator allows safely accessing nested properties of an object that could be null or undefined. If an intermediate property is null or undefined, the expression returns undefined instead of throwing an error. This avoids writing numerous manual checks and makes code more concise and readable.
What is the difference between null and undefined in JavaScript?
How to import a named function from an ES6 module?
+17 interview questions
Other Vue.js / Nuxt.js interview topics
JavaScript Fundamentals
Vue Basics
Vue Components
Vue Router
Pinia State Management
Vuex (Legacy)
Composition API
Vue Reactivity
Nuxt Fundamentals
Nuxt Data Fetching
Nuxt SSR & SSG
Nuxt Server Routes
Nuxt Modules
Vue Composables
Vue Forms & Validation
Nuxt State Management
Vue Testing
Nuxt Deployment & CI/CD
Vue Performance
Vue Advanced Patterns
TypeScript with Vue
Nuxt Authentication
SEO with Nuxt
Nuxt Internationalization
Vue Architecture
Nuxt Security
Vue Ecosystem
Migration Vue 2→3 & Nuxt 2→3
Master Vue.js / Nuxt.js for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free