/  JavaScript-Quiz-10

This Quiz contains totally 10 Questions each carry 1 point for you.

1. Variables created without the keyword var, are always global, even if they are created inside a function.

yes
No

Correct!

Wrong!

2. Can we define the function as follows?





var x = function(a, b){
return a*b;
}


yes
No

Correct!

Wrong!

3. Which of the following properties return the URL of the current page.

location.URL
URL.location
window.location.href
window.location.hostname

Correct!

Wrong!

4. How can you detect the client’s browser type?

navigator.platform
navigator.appName
navigator.userAgent
browser.appName

Correct!

Wrong!

5. You need to check the Internet connectivity status in a browser. Which method should you use?

navigator.isOnline
navigator.Online

Correct!

Wrong!

6. Find the intruder:

Function()
Number()
Math()
Boolean()

Correct!

Wrong!

7. The method confirm('message') will show:

dialog box
input field

Correct!

Wrong!

8. Which timing event is used to delay the execution of the function?

timer()
setTimeout()

Correct!

Wrong!

9. What would be the result?





document.getElementsByTagName("p");


array
HTMLcollection
number
paragraph

Correct!

Wrong!

10. Choose a way to add a new property “price” to the constructor “Shoes”.





function Shoes(color, size) {
this.color = color;
this.size = size;
}


Shoes.prototype.price=100;
Shoes.price=100;

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

Ignore & go to results

JavaScript-Quiz-10

You got %%score%% of %%total%% right

%%description%%

%%description%%

Where to go ?

Quizzes

Loading...