JavaScript Interview Questions

In this article I want to discuss some important topics about javaScript interview questions.

Double Equal (==) vs Triple Equal (===):

Null vs Undefined:

Undefined means that a variable is declared, but no value has been assigned a value. Null means an empty or non-existence value. You can assign it to a variable.

Scope in JavaScript:

  • Local Scope
  • Global Scope
  • Block Scope

When a variable defines outside of a function is in the global scope. Global variables can be accessed and modified from any function. And when a variable defines inside of a function is in the local scope. Local variables cannot be accessed or modified outside the function declaration. Block scope is related to the variables declared using let and const. Variables declared with var do not have block scope.

Apply .map(), .filter(), .find() in objects:

.map() returns a new array from an existing one. Look at the example below:

.filter() method takes each element in an array and it applies a conditional statement against it. It returns an array with less items than the original array.

.find() method returns the first items in an array that satisfies a condition. It is very much like the .filter() method, except it only returns a single element.

Apply call() , apply() and bind():

apply(): The apply method is similar to the call() method. The only difference is that, call() method takes arguments separately whereas, apply() method takes arguments as an array.

bind(): This method returns a new function, where the value of this keyword will be bound to the owner object, which is provided as a parameter.


Thanks a lot for reading. Thank you very much.

I have held responsible positions in specializing as Front-end Developer with sound knowledge over ReactJS for frontend and NodeJs for API Services.