Google News
logo
JavaScript - Quiz(MCQ)
1 .
Which attribute needs to be changed to make elements invisible?
A)
visibilty
B)
visible
C)
invisibility
D)
invisible

Correct Answer : Option (A) :  

visibilty

2 .
Which is not a primitive data type in JavaScript?
A)
boolean
B)
number
C)
string
D)
character

Correct Answer : Option (D) :  

character

3 .
Which event fires whenever a control loses focus?
A)
onclick
B)
onmove
C)
onblur
D)
onchange

Correct Answer : Option (C) :  

onblur

4 .
Which of the ways below is incorrect of instantiating a date?
A)
new Date(dateString)
B)
new Date()
C)
new Date(seconds)
D)
new Date(year, month, day, hours, minutes, seconds, milliseconds)

Correct Answer : Option (C) :  

new Date(seconds)

5 .
What is the correct JavaScript syntax for opening a new window called "ftl" ?
A)
ftl = window.open("http://www.freetimelearning.com");
B)
ftl = window.new("http://www.freetimelearning.com");
C)
ftl = window.targer("http://www.freetimelearning.com");
D)
ftl = new.window("http://www.freetimelearning.com");

Correct Answer : Option (A) :  

ftl = window.open("http://www.freetimelearning.com");

6 .
Which of the following is used to capture all click events in a window?
A)
window.captureEvents(Event.CLICK);
B)
window.routeEvents(Event.CLICK );
C)
window.handleEvents (Event.CLICK)
D)
window.raiseEvents(Event.CLICK );

Correct Answer : Option (A) :  

window.captureEvents(Event.CLICK);

7 .
How do you round the number 7.25, to the nearest integer?
A)
rnd(7.25)
B)
Math.rnd(7.25)
C)
Math.round(7.25)
D)
round(7.25)

Correct Answer : Option (C) :  

Math.round(7.25)

8 .
How would one declare a string variable?
A)
Any of these
B)
var fName = “FreeTimeLearn”;
C)
var names = “7”;
D)
var fName = new String;

Correct Answer : Option (A) :   Any of these

9 .
Why so Java and JavaScript have similar name?
A)
Java Script is a stripped-down version of Java
B)
The syntax of JavaScript is loosely based on Java syntax
C)
They both support Object Oriented Programming 
D)
None of the above

Correct Answer : Option (B) :  

The syntax of JavaScript is loosely based on Java syntax

10 .
How do you find the number with the highest value of x and y?
A)
top(x, y)
B)
Math.ceil(x, y)
C)
Math.max(x, y)
D)
ceil(x, y)

Correct Answer : Option (C) :  

Math.max(x, y)