10 JavaScript Question Which Can Be Asked During Interview.

Muhammadjoyhussain
2 min readMay 8, 2021

What Is JavaScript:

JavaScript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive.

Truthy and Falsy:

A truthy value is when we get the output of a value as true.
Example:
A number other than 0, space, an array with value.

A falsy value is when we get the output of a value as false.
Example:
0, “”, undefined, null, NaN.

Undefined and Null:

Undefined: In JavaScript, if an object declared but no parameter has been passed, it gives undefined by default.
Example:
function undefiend(num1, num2){
console.log(num1 + num2);
return
}
function add(num1, num2){
console.log(num1, num2);
}

Null: Null is an object. It can never be found as an output. We set null to check, is there any value left inside an object.

Clouser:

If I call a function from inside another function or return it, it will create a closed environment, and then the inside function will return if he accesses a variable outside that function, when you will use them it will store his own value.

Double Equal:

In JavaScript, we use double equal which checks value equality only. Before checking the values, it converts the types of the variable to match each other.

Tripple Equal:

Tripple equal checks if the values are equal also check what types of value it is. If any of them from value or type mismatches, it returns false.

What is Document Object Model(DOM)? :

The document object model is a programming interface for HTML and XML documents. It represents the page so that the document can change the structure, style and content.

Arrow function:

Arrow function is a feature that has been introduced in the ES6 version of JavaScript. It allows creating a function in which codes are cleaner than the older version of the functions.

Bind:

The bind() method allows an object to borrow a method from another object without making a copy of that method. In JavaScript, it's known as the borrowing function.

--

--