JavaScript Interview Questions
1 .
What is JavaScript ?
JavaScript is the programming language of the Web. Javascript Most commonly used websites this is client-side script to interact with the user and make dynamic pages. All modern web browsers on desktops, tablets, and smart phones are using JavaScript.
2 .
Which company developed JavaScript ?
The first JavaScript engine was created by Brendan Eich at Netscape, for the Netscape Navigator Web browser. The engine, code-named SpiderMonkey, is implemented in C. It has since been updated (in JavaScript 1.5) to conform to ECMAScript 3.
3 .
How to create function in JavaScript ?
To create function in JavaScript, follow the following syntax :

<script type="text/javascript">
   function function_name(){
     //function body
4 .
What is Javascript Variables ?
JavaScript uses reserved keyword var to declare a variable. A variable must have a unique name. You can assign a value to a variable using equal to (=) operator when you declare it or before using it.

There are two types of variables in JavaScript  :
1. local variables  : A variable that is declared inside of a function definition is called local variable and has scope to that function only. variables :  A variable that is declared outside of a function definition is called a global variable and its scope is throughout your program means its value is accessible and modifiable throughout your program.

Basic Syntax :
var <variable-name>;
var <variable-name> = <value>;
5 .
How many Operators in Javascript ?
JavaScript operators are used to assign values, compare values, arithmetic operations, and more. For example 1 + 2, where + sign is an operator and 1 is left operand and 2 is right operand. + operator adds two numeric values and produces a result which is 3 in this case.

1. Arithmetic Operators
2. Comparison Operators
3. Logical Operators
4. Bitwise Operators
5. Assignment  Operators
6 .
What are JavaScript Data Types ?
Following are the JavaScript Data types :

1. Primitive data type
2. Non-primitive (reference) data type

JavaScript has dynamic types. This means that the same variable can be used to hold different data types :
var x;     // Now x is undefined
var x = 10;     // Now x is a Number
var x = "Name";     // Now x is a String

Primitive data types : There are six types of primitive data types in JavaScript. They are as follows :

Non-Primitive data types : The non-primitive data types are as follows :
7 .
What is a prompt box ?
A prompt box is a box which allows the user to enter input by providing a text box.  Label and box will be provided to enter the text or number.
8 .
What is ‘this’ keyword in JavaScript ?
‘this’ keyword refers to the object from where it was called.
9 .
What is the difference between == and === ?
The == operator checks equality only whereas === checks equality and data type i.e. value must be of same type.
10 .
What is the function of delete operator ?
The functionality of delete operator is used to delete all variables and objects in a program but it cannot delete variables declared with VAR keyword.