JavaScript Most Important 10 Question

Shihabmilky
3 min readMay 10, 2021

What are truthy and falsy values?

All numbers are truthy without 0 and also all strings are truthy without empty string and any value is undefined then it is falsy value and also null , NaN is falsy value.

What is null vs undefined?

When I declare a variable but i don’t declare a variable value then this variable is undefined. Then When a declare function input 2 parameter but i don’t return prameter then this function value is undefined and when I declare function input parameter and return this parameter but i don’t pass a value then this is undefined. I declare a object with some property after i access a property value acutely this property didn’t declare into the object then this property value is undefined. When i declare an array with some element and i access a element by index this element index acutely isn’t defined. Or null is mean empty.

double equal (==) vs triple equal (===) implicit conversion ?

Usually double equal or triple equal are also operator. But they have some difference. Double equal mainy check the both data value are same if the both data value are same then return true. And triple equal are also not only check the both data it check also data type. If the both data type and both value are same if are same then it return true

What is Global Scope?

Global scope means this is not inside any function or inside {} . its declare the top parent and this value output we can see everywhere i mean any inside function or any loop or any condition.

What is Functional scope?

Functional scope means our declared variable available in this function. If we can see this variable value outside this function then we catch error.

What is Block scope?

Block scope means, block scope created when declaring a variable using let or const inside any {}, then creating a block scope And this scope variable can’t be accessed outside this block scope.

What is Hoisting ?

When we declare a variable using var inside a block scope then this variable declaration go to top to parent scope after when we set the variable value then this variable value available in the parent scope.

NOTE: hoisting just go to top the variable declaration not the value assigning

What is Clouser ?

When we call a function and inside the function we return another function and then if the return function accesses the parent scope variable or access global variable but return function value doesn’t access outside this return function this is clouser.

What are the differences Call , bind , apply ?

we can One object method used to another object with help of call(), bind(), apply() method

actually the call method used directly. Call method receive unlimited arguments. The first argument is this value and another argument we pass one by one argument which we need the object method parameter.

Or

the apply method used directly. But apply method receive two arguments. The first argument is this value and another argument we pass an array and inside this array we pass one by one which we need the object method parameter.

Or

the bind method don’t used directly. When bind method call its return function after when we need it Repeatedly then we can use it. bind method receives unlimited arguments. The first argument is this value and another argument we pass one by one argument which we need the object method parameter

Tell Something About this keyword?

The javascript ‘this’ keyword refers to the object it belongs to. It has different values depending where it is used. Alone and regular function this refer to the global object, in a method refers to the owner object.

--

--