JavaScript Interview Questions Collection-2
- What is ECMAScript in Javascript?
- what is the difference between var, let, and const?
- What are Spread Operator, Rest Operator, and default parameter?
- What are deep copy and shallow copy in Javascript?
- explain callback, promises, and async/await in Javascript?
- What is a higher-order function in Javascript?
- Explain different types of functions in Javascript?
- What is the arrow function in Javascript?
- Why do we use call, apply, and bind methods in Javascript?
- How many ways to create objects in Javascript?
- What is prototype inheritance in Javascript?
- What is typescript?
- What are the array method, and string method in Javascript?
- What is throttling and debouncing in JS?
- What is Null and undefined in Javascript?
- What is execution context, event loop, stack call queue, and microtask queue in Javascript?
- What is setTimeOut and setInterval in Javascript?
- What is the difference between set and map in Javascript?
- What is session storage, local storage, cookie?
- Write a program to sort an array?
- What is the use of json.stringify and json.parse() method in Javascript?
- explain map, filter, and reduce in Javascript?
- What is the generator function in Javascript?
- What is closure in Javascript?
- What is housing in Javascript?
- What is dead zone in Javascript?
- What is memorization in Javascript?
- What is function currying in Javascript?
- What is a mutation observer in Javascript?
- How to stop event propagation in Javascript?
- Write Hosting Example
- DIff: Normal vs Arrow function
- What is Event Capturing and event bubbling
- How to stop Event Capturing and event bubbling
- Spread and rest operator
- Debounce and Throttling
- How does TypeOf Operator work?
- List out the different ways an HTML element can be accessed in a JavaScript code
- What are the ways to define a variable in JavaScript?
- What is a prompt box?
- What is the ‘this’ keyword in JavaScript?
- setTimeout, setInterval, and clearInterval.
- What are the major advantages of JavaScript?
- What are the data types supported by JavaScript?
- JavaScript Functions – What do you know about it?
- What is the difference between JavaScript keywords – var and let.
- Array Destructuring vs Object Destructuring
- Difference between Arrow function and Regular Function
- Currying in JS
- What are the different Datatypes in JS?
- Difference between Null and Undefined
- Event Delegation in JS
- Event bubbling vs Event capturing
- Function declaration vs Function expression
- What is Memoization in JS?
- Difference between Primitive and Non-primitive datatype
- Prototypal Inheritance in JS
- What is a Pure function in JS?
- Scopes in JavaScript
- Difference between Shallow copy and Deep copy
- Significance of 'this' keyword
- What is Temporal Dead Zone in ES6?
- What are the different ways to clone an Object?
- What is IIFE( Immediately Invoked Function Expression)?
- What is the Callback function?
- What is the method to change the title of a page using JavaScript?
Ans. Generally, the page title varies based on the HTML document and the element structure. We can give id to an element and use code:
document.getElementById(‘page-title-id’).innerHTML=NewTitle;