JAVASCRIPT QUIZ
1 .
How to write an IF statement in JavaScript?

Correct Answer : Option (B)

if (i == 5)
  Show Answer
2 .
How to write an IF statement for executing some code if "i" is NOT equal to 5?

Correct Answer : Option (D)

if (i != 5)
  Show Answer
3 .
How does a WHILE loop start?

Correct Answer : Option (A)

while (i <= 10)
  Show Answer
4 .
How does a FOR loop start?

Correct Answer : Option (D)

for (i = 0; i <= 5; i++)
  Show Answer
5 .
Which of these is a correct method to create a new array?

Correct Answer : Option (B)

var myArray = [];
  Show Answer
6 .
How to append a value to an array of Java Script?

Correct Answer : Option (A)

arr[arr.length] = value
  Show Answer
7 .
How to return the first value of this array?
var myArr = [1, 2, 3, 4, 5];

Correct Answer : Option (A)

myArr[0];
  Show Answer
8 .
Which is the correct way to write a JavaScript array?

Correct Answer : Option (C)

var txt = new Array("abc","efg","xyz")
  Show Answer
9 .
Which event occurs when the user clicks on an HTML element?

Correct Answer : Option (C)

onclick
  Show Answer
10 .
Which of the following is the tainted property of a window object in Java Script?

Correct Answer : Option (C)

Defaultstatus
  Show Answer