Nahidul Islam
4 min readNov 5, 2020

--

Top JavaScript interview question you have to must know that

Today I am discussing the most popular JavaScript Interview question that has you must know. Still, I am learning JavaScript, So, that I am sharing my little bit of knowledge with all of you.

Photo by Irvan Smith on Unsplash

JavaScript Interview Question

Truthy and falsy List

What is Undefined and Null

The undefined and null both are primitive dataType value. Undefined indicates that the variable has been declared but not has been assigned value. The type of undefined value is also undefined too.

On the other hand, null is an assignment value, it can be assigned to a variable as a representation of no value. Value null represents the absence of any object value. The type of null value is an object.

Difference between Null & Undefined

Difference between operator == and ===

The main difference between the two operators, where are == operator checks quality only, on the other hand, === operator checks equality and data type, for example, a value must be the same type.

Difference between Map, Filter, and Find method

The map method creates a new array with the result of the calling function for every array element. This method calls the provided function once for each element in an array in order. The important thing is that the map method does not execute the function for an array element without the values. This map() method does not change the original array.

The Filter method is used to filters all the elements and returns the elements that are matching and remove the elements that are not matching.

The Find() method is used to find all child elements of the selected elements. This find method traversing the DOM tree through the root to leaf.

What is the scope of a variable in JavaScript?

The scope is determined that it is accessibility or visibility of a variable or the other resource in the area of your code.

In JavaScript variable have only two scopes. There are Global variables and Local variables. The global variables have a global scope which means it is visible anywhere in javaScript code. On the other hand, Local variables have a local scope which means it is visible or access can within a function where it is defined or declared. The function parameters are always local variables. Local variables or local scope can be divided into function scope and block scope.

Difference between Call, Apply and Bind

The call() method calling or invokes a function with a given this value and arguments provided one by one. The call method takes arguments separately and the Apply method takes arguments as an array.

The Apply method () is similar to the call() method. Here call() method takes arguments separately and the Apply method takes arguments as an array.

The Bind() method is to return a new function that allows you to pass the array and any number of arguments.

Difference between Window and Document in JavaScript

That’s all today, next time I will share another important topic.

--

--

Nahidul Islam

AWS Certified Solutions Architect - Associate || DevOps Enthusiast || JavaScript Developer at SEBPO