0% found this document useful (0 votes)
2 views2 pages

JavaScript_Interview_QA_Basics

The document provides a list of basic to intermediate JavaScript interview questions and answers covering various topics such as data types, closures, hoisting, arrow functions, event bubbling, promises, and the 'this' keyword. It also explains the differences between 'var', 'let', and 'const', as well as synchronous and asynchronous programming. Additionally, it highlights important array methods and features like template literals and destructuring.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

JavaScript_Interview_QA_Basics

The document provides a list of basic to intermediate JavaScript interview questions and answers covering various topics such as data types, closures, hoisting, arrow functions, event bubbling, promises, and the 'this' keyword. It also explains the differences between 'var', 'let', and 'const', as well as synchronous and asynchronous programming. Additionally, it highlights important array methods and features like template literals and destructuring.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Interview Questions and Answers (Basic to Intermediate)

1. What are the different data types present in JavaScript?

- Primitive: String, Number, BigInt, Boolean, undefined, Symbol, null

- Non-Primitive: Object (includes Arrays, Functions)

2. Difference between == and ===?

- == performs type coercion

- === checks both value and type

3. What is a closure?

- A closure is a function that retains access to its lexical scope even when executed outside that

scope.

4. What is hoisting?

- Hoisting is JavaScript's behavior of moving declarations to the top of the scope.

5. What are arrow functions?

- Arrow functions are a concise way to write functions and don't bind their own 'this'.

6. Difference between var, let, and const?

- var: Function scope, hoisted, can reassign/redeclare

- let: Block scope, not hoisted, can reassign, not redeclare

- const: Block scope, not hoisted, cannot reassign or redeclare

7. What is event bubbling?

- Events propagate from the target element up to the root.


8. What are promises?

- Promises represent the eventual result of an asynchronous operation.

9. Difference between null and undefined?

- undefined: Variable declared but not assigned

- null: Variable assigned with no value intentionally

10. Explain the 'this' keyword.

- Refers to the object it belongs to. Arrow functions inherit 'this' from their parent scope.

11. Synchronous vs Asynchronous?

- Synchronous: Executes line-by-line

- Asynchronous: Executes tasks in the background using callbacks/promises

12. Use of async and await?

- async makes a function return a promise

- await waits for the promise to resolve

13. What are template literals?

- Strings enclosed by backticks allowing embedded expressions using ${}

14. What is destructuring?

- Extracting values from arrays/objects into distinct variables.

15. Important Array Methods?

- map(), filter(), reduce(), forEach(), find(), some(), every(), includes()

You might also like