Home » JS » Top Javascript Interview Questions And Answers Part 2

Top Javascript Interview Questions And Answers Part 2

1. How can you create an Array in JavaScript?

We can define arrays using the array literal which are below-

var A = [];
var B = [1, 2, 3];

2. What is the use of ‘This’ operator in JavaScript?

this keyword refers to the object it belongs to.

3. What is Callback?

callback is a plain JavaScript function passed to some method as an argument or option. Callback is a function that is to be executed after another function has finished executing. In JavaScript, functions are objects. Because of this, functions can take functions as arguments, and can be returned by other functions.

4. Name some of the JavaScript Frameworks?

A JavaScript framework is an application framework written in JavaScript. It differs from a JavaScript library in its control flow. The most commonly used frameworks are:

  • Angular
  • React
  • Vue
  • Node

5. What is NaN in JavaScript?

NaN is a short form of Not a Number. When a string or something else is being converted into a number and that cannot be done, then we get to see NaN.

Leave a Reply

Your email address will not be published. Required fields are marked *