Junior JavaScript Developer Interview Flashcards

1. What are the different data types in JavaScript?
Number, String, Boolean, Null, Undefined, Object, Symbol, BigInt.
2. What is the difference between var, let, and const?
3. What is a closure in JavaScript?
A closure is a function that remembers and accesses variables from its outer scope even after that outer function has finished executing.
4. What are arrow functions, and how are they different from regular functions?
Arrow functions have a shorter syntax and do not have their own this, arguments, or super. They inherit this from their surrounding context.
5. Explain event bubbling.
Event bubbling is the process where an event starts from the deepest target element and then propagates up to its ancestors in the DOM tree.
6. How do you create an object in JavaScript?
7. What is the difference between == and ===?
8. What is hoisting?
Hoisting is JavaScript's behavior of moving declarations (var, function) to the top of their scope before code execution.
9. How does the this keyword work?
this refers to the object that is executing the current function. It varies based on how the function is called.
10. What are promises in JavaScript?
Promises represent the eventual completion (or failure) of an asynchronous operation and its resulting value.
11. What is the difference between synchronous and asynchronous code?
12. What is the DOM?
The Document Object Model (DOM) is a programming interface for HTML and XML documents, representing the page so scripts can change the document structure, style, and content.
13. How do you handle errors in JavaScript?
Using try...catch blocks, and optionally finally to run code regardless of error.
14. What is the difference between null and undefined?
15. What is the purpose of the map() method?
map() creates a new array by applying a function to each element of the original array.