Top 10 JavaScript Interview Questions and Answers

Interview Questions
  1. What are JavaScript Data Types?

Number, String, Boolean, Object, Undefined

2. What is ‘this’ keyword in JavaScript?

‘This’ keyword refers to the object from where it was called.

3. What is === operator?

=== is called a strict equality operator, which returns true when the two operands have the same value without conversion.

4. Difference between “==” and “===”?

“==” checks only for equality in value, whereas “===” is a stricter equality test and returns false if either the value or the type of the two variables are different.

5. What do you mean by NULL in JavaScript?

The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number, and no array object.

6. What are all the looping structures in JavaScript?

For , While

7. How can a particular frame be targeted, from a hyperlink, in JavaScript?

This can be done by including the name of the required frame in the hyperlink using the ‘target’ attribute.

8. What is an undefined value in JavaScript?

Variable used in the code doesn’t exist, Variable is not assigned to any value, Property does not exist.

9. . What is the unshift method in JavaScript?

Unshift method is like the push method, which works at the beginning of the array. This method is used to prepend one or more elements to the beginning of the array.

10 . What is event bubbling?

JavaScript allows DOM elements to be nested inside each other. In such a case, if the handler of the child is clicked, the handler of the parent will also work as if it were clicked too.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store