10 Most JavaScript Interview Question

Kamrul Hasan
2 min readMay 8, 2021

What is the difference between Null vs Undefined?

Ans: Null is an assigned value. It means nothing. Undefined means a variable has been declared but not defined yet.

What is the difference between double(==) vs triple(===)?

Ans: Duble(==) in javascript is used for comparing two variables, but it ignores the data type of variable. Triple(===) is used for comparing two variables, but this operator also checks the data type and compares two values. It returns true only if both values and data types are the same of two variables.

What is the difference between call(), bind(), and apply() in javascript?

Ans: The call() method invokes a function with a given ‘this’ value and arguments provided one by one. Bind() returns a new function allowing to pass in an array and any number of arguments. Apply() invokes the function and allows you to pass in an array and any number of arguments.

What is the ‘this’ keyword in javascript?

The JavaScript this keyword refers to the object it belongs to. It has different values depending on where it is used. In a function, this refers to the global object, its strict mode and this is undefined. In an event, this refers to the element that received the event.

What is an event bubble?

Ans: Event bubbles direct an event to its intended target. For example, A button is clicked and the event is directed to the button. If an event handler is set for that object the event is triggered. If no event handler is not set this object the event bubbles up to the object's parent.

What is the arrow function?

Ans: Arrow function is one of the features introduced in the ES6 version of JavaScript. It allows you to create functions in a cleaner way compare to regular functions.

What is DOM?

Ans: DOM means Document Object Model. The dom is an object-oriented representation of the web page which can be modified with a scripting language like javascript.

What is recursion?

Recursion is a process of calling itself. A function that calls itself is called a recursive function.

What is API?

API means Application Programming Interfaces. These are construct made available in programming languages to allow developers to create complex functionality more easier.

What is a callback function?

In JavaScript, a callback function is a function passed into another as an argument to be executed later.

--

--