Java Script Interview QUESTIONS
Exam Name | Java Script Interview QUESTIONS |
---|---|
Description | Java Script Interview QUESTIONS contains the questions from various interview of IT industry.These questions are helpful to crack the IT interview. |
Exam Type | MASTER EXAM |
Authenticity | 3 |
creator | Payal(381) |
.
Question:
What is JavaScript?
Answer:
Question:
What is the difference between JavaScript and Jscript?
Answer:
Question:
Is JavaScript case sensitive?
Answer:
A function getElementById is not the same as getElementbyID.
Question:
What are the types used in JavaScript?
Answer:
Question:
What is the difference between "==" and "==="?
Answer:
"===" checks for equality as well as the type.
Question:
What are the boolean operators supported by JavaScript?
Answer:
Or Operator: ||
Not Operator: !
Question:
How to access the value of a textbox using JavaScript?
Answer:
Question:
What are the ways of making comments in JavaScript?
Answer:
ex:- var x=10; //comment text
/*
*/ is used for block comments
Question:
How will you get the Checkbox status whether it is checked or not?
Answer:
Question:
How to create arrays in JavaScript?
Answer:
a) The first way to create array
Declare Array:
var names = new Array();
Add Elements in Array:-
names[0] = "Vikas";
names[1] = "Ashish";
names[2] = "Nikhil";
b) This is the second way:
var names = new Array("Vikas", "Ashish", "Nikhil");
Question:
How do you submit a form using JavaScript?
Answer:
Question:
What does isNaN function do?
Answer:
Question:
What is the use of Math Object in JavaScript?
Answer:
ex:-
var x = Math.PI; // Returns PI
var y = Math.sqrt(16); // Returns the square root of 16
var z = Math.sin(90); Returns the sine of 90
Question:
What do you understand by this keyword in JavaScript?
Answer:
var obj = { outerWidth : 20 };
function say() {
alert(this.outerWidth);
}
say();//will alert window.outerWidth
say.apply(obj);//will alert obj.outerWidth
Question:
What does "1"+2+4 evaluate to?
Answer:
Question:
What does 3+4+"7" evaluate to?
Answer:
Question:
How do you change the style/class on any element using JavaScript?
Answer:
OR
document.getElementById(“myText”).className = “anyclass”;
Question:
What is an object in JavaScript, give an example?
Answer:
var man = new Object();
man.name = 'Vikas Ahlawat';
man.living = true;
man.age = 27;
Question:
Name any two JavaScript functions which are used to convert nonnumeric values into numbers?
Answer:
parseInt()
parseFloat()
Question:
Does JavaScript Support automatic type conversion, If yes give example.
Answer:
var s = '5';
var a = s*1;
var b = +s;
typeof(s); //"string"
typeof(a); //"number"
typeof(b); //"number"