Here is a list of your javascript interview questions that is going to help you prepare before your next job interview. Go through these questions and get your dream job.
What do you understand by Closures?
A closure is basically an inner function that has access to the variables declared in its outer scope.
Closure basically has access to three scopes -
- Its own variables
- Outer scope variables
- Global variables
What is the use of clearTimeout() method?
The clearTimeout () method is used to clear the timeout that has been set by the setTimeout() method.
Can we redeclare let and const variables?
No, We cannot redeclare let and const variables.
What is the difference between call() & apply() method?
Call() & apply() both methods are used to invoke the function with the given this context and provided parameters. In the case of call(), parameters are passed one by one but in apply() method parameters are passed as an array.
What is first class function in javascript?
In javascript, functions are known as first-class citizens. First-class function means a function can be assigned as a value to a variable, can be passed as an argument to another function, a function can be returned from a function.
What is the difference between local storage and session storage?
The main difference between SessionStorage and LocalStorage is that in the case of local storage the data is preserved when the browser tab is closed
What is the use of Object.seal() method?
Object.seal() method is used to seal an object which means new properties cannot be added to the object but values of existing properties can be changed as long as they are writable.
What is the difference between foreach and map?
Foreach is used to iterate over an array execute callback function on each element of the array and does not return anything.
Map iterates over an array calling the callback function on each item of an array and returns a new array.
What is Hoisting?
Hoisting is the concept in javascript in this all the variable declarations are moved to the top of the script.
What are callbacks?
Callbacks are those functions that are passed to another function as an argument and get executed when that passing function finishes its execution.
Subscribe to our Youtube channel for more:
videos :https://www.youtube.com/channel/UCEXWe9R6-ppk4zhNo2JbtmQ