must know interview question

Md Abdul Aziz
3 min readMay 8, 2021

1. What Falsy value?

ans: falsy value is value but it is false. it is indicated in the boolean value.

false value:

  • undefined
  • null
  • empty string
  • NaN
  • false
  • 0

2. What Truth value?

ans: Truth is a value.it is always indicated by true and boolean values. it is opposite in falsy value,

Truth value:

  • 1
  • “0”
  • “ ”
  • []

3.what is undefined?

ans: when the programmer writes some code and not declare value but it is accessible so it is undefined.

example:

let name;

console.log(name) //undefined

function not return but outside calling it is given undefined

function add(num1,num2){

console.log(num1+num2)

}

const sum=(10,20)

console.log(sum) //undefined

function return but tell function do , given undefined

function add(num1,num2){

return

}

const sum=(10,20)

console.log(sum) //undefined

function parameter declear but not pass calling function do , given undefined

function add(num1,num2){

return num1+num2;

}

const sum=(10)

console.log(sum) //undefined

Read Object: not declare object property but it is access given undefined.

const name={name= “aziz”}

console.log(name.phone)//undefined

Null: it is mean empty.

4.what is double equal?

ans: it is comparing two values. left and right site. but it is not value check type.

example:

2==”2" //true

1==true//true

0==false //true

5.what is triple equal?

ans: it is comparing two values. left and right site. but it is strictly a value check type.

example:

2===”2" //false

1===true//false

0===false //false

6.what is scope in javascript?

ans: javascript is a function scope.it is a determining variable, The two types of scope are local and global. local means it is defined by the inside of a function. global means out the site of function.

7.what is closure in javascript?

ans: closure in javascript function it is inner function access in the outer function.

1st create one function and return or callback another function. callback or return function access outer variable from own value and return function it is called closure.

8.call and apply differently?

ans: if any object is given any method, and is apply another object, using call, apply or bind.

9.what is a recursive function?

ans: create the function and return inside of a function it’s called a recursive function.

We can also define functions recursively: in terms of the same function of a smaller variable. In this way, a recursive function “builds” on itself. A recursive definition has two parts: Definition of the smallest argument (usually f (0) or f (1)). Definition of f (n), given f (n — 1), f (n — 2), etc.

10. Fibonacci sequence?

ans: The Fibonacci sequence is, by definition,it is mean sum off after two numbers.

example:0,1,1,2,3,5….n

initial=0;

second=1;

result=0+1=1;

again;

secon+result=new result……..n;

11.what is event bubbling?

ans: when click any location event bubble working now, at first click region go and check event handler. if self-employed event handler it clicks now and go to parent and again go-to the parent.

handle propagating two way :

  1. immediate propagating
  2. stop propagating

12.What is javascript, key features of javascript?

Javascript is a high-level programming language that is used widely in the modern web. It is a client-side as well as a server-side language

Features of JavaScript

  • Object-Centered Script Language.
  • Client edge Technology.
  • Validation of User’s Input.
  • Else and If Statement.
  • Interpreter Centered.
  • Ability to perform In Built Function.
  • Case Sensitive format.
  • Light Weight and delicate.

--

--