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

JavaScript Interview QA MCA

The document provides a comprehensive list of JavaScript interview questions and answers, focusing on key concepts such as data types, DOM manipulation, event handling, and asynchronous programming. It highlights differences between various JavaScript features and methods, including variable declarations, comparison operators, and storage options. This resource is tailored for individuals preparing for interviews in the field of web development, particularly those with a Master of Computer Applications (MCA) background.

Uploaded by

saikatpain30
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

JavaScript Interview QA MCA

The document provides a comprehensive list of JavaScript interview questions and answers, focusing on key concepts such as data types, DOM manipulation, event handling, and asynchronous programming. It highlights differences between various JavaScript features and methods, including variable declarations, comparison operators, and storage options. This resource is tailored for individuals preparing for interviews in the field of web development, particularly those with a Master of Computer Applications (MCA) background.

Uploaded by

saikatpain30
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JavaScript Interview Questions & Answers (MCA Focus)

1. What is JavaScript?
JavaScript is a client-side scripting language used to make web pages interactive and
dynamic.

2. Difference between var, let, and const?


var has function scope, let has block scope, const has block scope and cannot be reassigned.

3. Difference between == and ===?


== compares values, === compares value and data type.

4. What is DOM?
DOM represents the HTML page as a tree structure so JavaScript can manipulate it.

5. How do you select elements in DOM?


Using getElementById, getElementsByClassName, querySelector, querySelectorAll.

6. What is an event?
An event is a user action like click, submit, or keypress.

7. What is event bubbling?


Event flows from child element to parent elements.

8. Difference between innerHTML and innerText?


innerHTML includes HTML tags, innerText shows only text.

9. What is hoisting?
JavaScript moves declarations to the top before execution.

10. What is form validation?


Checking user input before submitting data to the server.

11. What are data types in JavaScript?


Primitive: Number, String, Boolean, Undefined, Null. Non-primitive: Object, Array, Function.
12. Difference between null and undefined?
undefined means not assigned, null means empty value.

13. What is a function?


A reusable block of code to perform a task.

14. What is an arrow function?


Short syntax for writing functions.

15. What is a callback function?


A function passed as an argument to another function.

16. What is this keyword?


Refers to the object that calls the function.

17. What is NaN?


NaN means Not a Number.

18. What is strict mode?


'use strict' helps write secure and error-free code.

19. What is addEventListener?


Used to attach an event handler to an element.

20. Difference between slice and splice?


slice does not modify array, splice modifies array.

21. What is localStorage?


Stores data permanently in the browser.

22. Difference between localStorage and sessionStorage?


localStorage persists, sessionStorage clears after tab close.

23. What is closure?


A function that remembers its outer scope variables.
24. What is asynchronous JavaScript?
Non-blocking execution like API calls.

25. What is Promise?


Used to handle asynchronous operations.

26. What is async/await?


Simplifies asynchronous code.

27. What is JSON?


A lightweight data format for data exchange.

28. What is type coercion?


Automatic conversion of data types.

29. What is memory leak?


Memory not released properly causing performance issues.

30. Difference between for...in and for...of?


for...in iterates keys, for...of iterates values.

You might also like