JavaScript Most Important Interview Questions

01. What are truthy and falsy values?

Truthy values: Any numbers value truthy others than 0 and any string values truthy other than an empty string.

02. What is the difference between null and undefined?

Undefined: Unintentionally missing values. undefined is negative/falsy values. undefined is variable declared but not the value set and function explicitly not a return value or function call but not parameters pass, and any object property access but this property not in an object this called undefined. undefined means a variable has been declared but not defined yet.

03. Javascript double equal (==) vs triple equal (===)?.

double equal (==): Used for comparing two variables, but it ignores the data type of the variable.

04. What is hoisting?

Hoisting: Hoisting is any declaration variable moved to the top of the function. like (var variable).

05. What is block Scop?.

Block Scop: We know javascript ES works in the block scop System area. If we see {}(curly brackets), it is block scop in ES6.let const keywords allow developers to declare variables in the block scope, in not accessible out of scope.

06. What is the window?.

window: The window is a javascript works place running environment and javascript execution is a global variable. it anywhere accessible. Global variables allow you to access data between collections,
requests, test scripts, and environments. Global variables
are available throughout a workspace.

07. What is “this” keyword?.

this keyword: “this” is a special keyword that allows you to access a certain object directly in the current scope, no matter where your current function is. By default, it refers to the global object. Js, it’ll be global and in Browser, it’ll be a window.

08. What is setTimeout() ?.

setTimeout: The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds. like: 1000 ms = 1 second.The function is only executed once.

09. JavsScript synchronous or asynchronous?.

synchronous: JavaScript is always synchronous and single-threaded. JavaScript is only asynchronous in the sense that it can make, for example, Ajax calls. The Ajax call will stop executing and others code executes able and the callback will run synchronously.

10. What is setInterval()?.

setInterval(): The setInterval() method repeats a given function at every given time interval. function call again and again.

11. ArrayMax.

12. Remove duplicate items from an array..

13. Count the number of words in a string..

14. Reverse a string.

15. Calculate the Factorial of a number using for loop.

16. Calculate Factorial in a Recursive function.

17.Create a Fibonacci Series using a for a loop.

18. Create the Fibonacci series in a recursive way.

19.Prime Number or not.


I'm a Front-end Developer and Familiar with work's Backend. I enjoy working with Team as a leader or member.I Always learning New technology. I enjoy it.