Nlogn Profile picture
7 Oct, 21 tweets, 11 min read
Popular JavaScript Interview Questions with Answers.

JavaScript is the most popular language with ample job opportunities. Here is the list of 20 most asked javascript interview questions to speed up your preparation.

🧵A Thread 🧵

#100DaysOfCode (RT for reach)
1. What's the difference between undefined and null?

"undefined" is the default value of a variable that has not been assigned a specific value and "null" is a value that represents no value.

#100DaysOfCode
3. What does the || operator do?

The || or Logical OR operator finds the first truthy expression in its operands and returns it. This too employs short-circuiting to prevent unnecessary work.

#100DaysOfCode #javascript
4. What is DOM?

DOM stands for Document Object Model is an interface (API) for HTML and XML documents. When the browser first reads our HTML document it creates a big object, a really big object based on the HTML document this is the DOM.

#100DaysOfCode #javascript
5. What is Event Propagation?

Event propagation is a mechanism that defines how events propagate or travel through the DOM tree to arrive at its target and what happens to it afterward.

#100DaysOfCode #javascript
6. What's Event Bubbling?

In the Bubbling Phase, the event bubbles up or it goes to its parent, to its grandparents, to its grandparent's parent until it reaches all the way to the window.

#100DaysOfCode #javascript
7. What's Event Capturing?

In Capturing Phase, the event starts from the window all the way down to the element that triggered the event.

#100DaysOfCode #javascript
8. What is event.target ?

The https://t.co/xKPmG7ly7x is the element on which the event occurred or the element that triggered the event.

#100DaysOfCode #javascript
9. What's the difference between == and === ?

The difference between ==(abstract equality) and ===(strict equality) is that the == compares by value after coercion and === compares by value and type without coercion.

#100DaysOfCode #javascript
10. Why does it return false when comparing two similar objects in JavaScript?

#JavaScript compares objects and primitives differently. In primitives, it compares them by value while in objects it compares them by reference or the address in memory where the variable is stored.
11. What does the !! operator do?

The Double NOT operator or !! coerces the value on the right side into a boolean. Basically, it's a fancy way of converting a value into a boolean.

#100DaysOfCode #javascript
12. How to evaluate multiple expressions in one line?

We can use the, or comma operator to evaluate multiple expressions in one line. It evaluates from left-to-right.

Example -

x = (x++ , x = addFive(x), x *= 2, x -= 5, x += 10);

#100DaysOfCode #javascript
13. What is Hoisting?

Hoisting is the term used to describe the moving of variables and functions to the top of their (global or function) scope on where we define that variable or function.

#100DaysOfCode #javascript #Developer
14. What is Scope?

Scope in JavaScript is the area where we have valid access to variables or functions.

JavaScript has three types of Scopes -

1. Global Scope
2. Function Scope
3. Block Scope(ES6).
15. What are the falsy values in JavaScript?

falsy values are values that when converted to boolean becomes false.

#100DaysOfCode #javascript #Developer
16. What does "use strict" do?

"use strict" is an ES5 feature in JavaScript that makes our code in Strict Mode in functions or entire scripts. Strict Mode helps us avoid bugs early on in our code and adds restrictions to it.

#100DaysOfCode #javascript #Developer
17. What's the value of this in JavaScript?

"this" refers to the value of the object that is currently executing or invoking the function.

#100DaysOfCode #javascript #Developer
18. What is the prototype of an object?

A prototype in simplest terms is a blueprint of an object. It is used as a fallback for properties and methods if it does exist in the current object. It's the way to share properties and functionality between objects.

#100DaysOfCode
19. What are Higher Order Functions?

Higher-Order Function is functions that can return a function or receive argument or arguments which have a value of a function.

#100DaysOfCode #javascript
20. What's the difference between var, let, and const keywords?

Variables declared with "var" keyword are function scoped. Variables declared with "let" and "const" keyword are block-scoped.
Difference b/w let & const we can assign new values using let but we can't in const
Subscribe to our FREE interview and system design preparation bi-weekly newsletter.

#100DaysOfCode

nlogn.in/newsletter

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nlogn

Nlogn Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!