10 Basics of JavaScript Interview Questions That you need to know!

Albi Ummid
3 min readMay 8, 2021

--

1.True and False values in Js

There are few fundamentals of values that we have faced but ignored to know in detail.

False value :

  • Empty String
  • 0
  • null
  • NaN (not a number)
  • undefined
  • false

Look like false value but not:

  • 0 in String — “0”
  • Space in String — “ ”

2. ‘ ==’ vs ‘===’ ; what is the difference?

The Double Equal sign defines that both values in the opposite position of the sign are equal. But don’t declare their data type is the same. But the Triple equal sign defines that two values are the same and their data type also the same.

Example:

3.What is the difference between null and undefined?

Null: Null means an empty or a value that does not exist so null means nothing.

Undefined: Undefined refers to a value that may be declared but is not defined.

4.Scope:

Scope means a restricted area, where variables can’t be accessible if they are declared with let or const. In a function, if we declare a value it can’t be accessible from outside because it has a scope and it is not a global variable. By declaring a value outside of a function or declare with var car remove this scope.

5.What is a Global Variable?

If a value declared with let or const in a function that cannot be accessible from outside but if it did with var it can be accessed from outside of the function but the function should be called first because by running the function it will declare the value globally, otherwise no value will exist.

6.What is Event Bubble?

It’s a common thing in JavaScript. If we add an event listener to a button and also add an event listener to a div that containing that button and console.log them both they both respond that they are clicked but you clicked only the button that is the reason when you add an event on a child of an element then parent element also in the event.

7. What is the difference between the arrow function and the traditional function?

Arrow function is a replacement of the traditional function structure of JavaScript.It is popular nowadays but it has limitations too.

8.What is DOM?

DOM — Document Object Model is a programming interface for HTML and XML. It represents the properties, methods, and events of the page. When a page loaded. The browser creates a DOM of the page Then compiles and shows them.

9.What is Web API?

API stands for Application Programing Interface. And a web API is an application programming interface for the web. Practically Api connects web pages or websites to the backend server and share data as a JSON file and update the functionality, user interfaces by provided data. It helps a website to load data from the backend and makes web applications lightweight.

10.Explain API’s GET, Post Method:

Get is a method of the backend to send specific data by calling a specific domain address in the backend. And Post is a method of Adding /patching data on the backend server. this way users can upload /update their data to the server.

--

--

Albi Ummid
0 Followers

A self motivated JavaScript developer