My Report (&Account)

JavaScript Online Test


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)

Here is the complete list of test quizzes on JavaScript.

1. Which of the following are client-side JavaScript object?

Question 1 of 50 (sanfoundry.com)

2. Which is the method invoked to connect the last vertex back to the first?

Question 2 of 50 (sanfoundry.com)

3. What will happen if the browser encounters a script tag without an src attribute?

Question 3 of 50 (sanfoundry.com)

4. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
var x = 10;
var y = 20;
document.getElementById("demo").innerHTML = x + y;
</script>

Question 4 of 50 (sanfoundry.com)

5. Which of the following is the window that the Firefox sends the error messages to?

Question 5 of 50 (sanfoundry.com)

6. The events that are not directly tied to a specific input device are _____________

Question 6 of 50 (sanfoundry.com)

7. What is the special feature of modern web applications?

Question 7 of 50 (sanfoundry.com)

8. In how many modes can the Closure compiler be run?

Question 8 of 50 (sanfoundry.com)

9. What will be the output of the following JavaScript code?

[x,y]=[y,x];

Question 9 of 50 (sanfoundry.com)

10. Which of the following reads the textual contents of a URL and returns as a string?

Question 10 of 50 (sanfoundry.com)

11. What is the purpose of the RegExp method test()?

Question 11 of 50 (sanfoundry.com)

12. What will be the output of the following JavaScript code?

let a = 0;
for (a; a < 5; a++);
console.log(a);

Question 12 of 50 (sanfoundry.com)

13. Which is the JavaScript code that asks for the set of all div elements in a document?

Question 13 of 50 (sanfoundry.com)

14. How many properties are there in the interface PerformanceTiming?

Question 14 of 50 (sanfoundry.com)

15. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var res = "";
   res = res + Number.isInteger('123');
   document.getElementById("demo").innerHTML = res;
}
</script>

Question 15 of 50 (sanfoundry.com)

16. Which form of event propagation handles the registered container elements?

Question 16 of 50 (sanfoundry.com)

17. Which of the following is a loosely-typed language?

Question 17 of 50 (sanfoundry.com)

18. Which of the following attribute of form tag is not set by using document object in JavaScript?

Question 18 of 50 (sanfoundry.com)

19. How will you update the URL displayed in the location bar?

Question 19 of 50 (sanfoundry.com)

20. Which property is used to obtain browser vendor and version information?

Question 20 of 50 (sanfoundry.com)

21. Which of the following layer retrieves the content from the network?

Question 21 of 50 (sanfoundry.com)

22. Which is the function used to loop in an array to view all the values?

Question 22 of 50 (sanfoundry.com)

23. What will be the output of the following JavaScript code?

var add=new Function("num1","num2","return num1+num2");  
document.writeln(add(2,5));  

Question 23 of 50 (sanfoundry.com)

24. Why do we need to use an onload event in the script tag after using the async attribute?

Question 24 of 50 (sanfoundry.com)

25. What is the purpose of minifying the JavaScript?

Question 25 of 50 (sanfoundry.com)

26. Which method is an alternative of the property location of a window object?

Question 26 of 50 (sanfoundry.com)

27. What will be the possible output of the following JavaScript code?

var a = [1,2,3,4,5];
a.slice(0,3);

Question 27 of 50 (sanfoundry.com)

28. What will be the output of the following JavaScript code?

function emp(id,name)
{  
    this.id=id;  
    this.name=name;    
}  
e=new emp(103,"Vimal Jaiswal");  
  
document.write(e.id+" "+e.name");  

Question 28 of 50 (sanfoundry.com)

29. What is the purpose of the parameter $name ?

Question 29 of 50 (sanfoundry.com)

30. Client-side JavaScript code is embedded within HTML documents in __________

Question 30 of 50 (sanfoundry.com)

31. Which function is a synonym for on()?

Question 31 of 50 (sanfoundry.com)

32. How many parameters does the WebPageTest API accept?

Question 32 of 50 (sanfoundry.com)

33. What will be the efficiency quotient of the following JavaScript statements?

var Set = sets.Set;
var s = new Set(1,2,3);

Question 33 of 50 (sanfoundry.com)

34. What is the purpose of the startTimeLogging() method?

Question 34 of 50 (sanfoundry.com)

35. What will be the output of the following JavaScript code?

var a1 = [,,,]; 
var a2 = new Array(3); 
0 in a1 
0 in a2

Question 35 of 50 (sanfoundry.com)

36. What will be the output of the following JavaScript code?

<p id="demo"></p>
var txt1 = "good";
var txt2 = "day";
document.getElementById("demo").innerHTML = txt1 + txt2;

Question 36 of 50 (sanfoundry.com)

37. Carakan is used by which of the following browsers?

Question 37 of 50 (sanfoundry.com)

38. Which event handler is triggered when the user's mouse moves away from a link?

Question 38 of 50 (sanfoundry.com)

39. Which is the root element in a HTML document?

Question 39 of 50 (sanfoundry.com)

40. Which keyword is used to define the function in javascript?

Question 40 of 50 (sanfoundry.com)

41. What is the prototype represents in the following JavaScript code snippet?

function f() {};

Question 41 of 50 (sanfoundry.com)

42. A new web browser window can be opened using which method of the Window object?

Question 42 of 50 (sanfoundry.com)

43. Which of the following are not key event properties?

Question 43 of 50 (sanfoundry.com)

44. What will be the output of the following JavaScript code?

<head id="myHead">
</head>
<p id="demo"></p>
<script>
function myFunction() 
{
   var x = document.head.id;
   document.getElementById("demo").innerHTML = x;
}
</script>

Question 44 of 50 (sanfoundry.com)

45. Which HTML element is used to include images?

Question 45 of 50 (sanfoundry.com)

46. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
var str = "HELLO, LOOK AT YOU!"; 
var patt1 = /\bLO/;
var result = str.search(patt1);
document.getElementById("demo").innerHTML = result;
</script>

Question 46 of 50 (sanfoundry.com)

47. What are the two output formats YSlow uses?

Question 47 of 50 (sanfoundry.com)

48. Which of the following functions are referenced internally?

Question 48 of 50 (sanfoundry.com)

49. The return type of getElementsByClassName() is __________

Question 49 of 50 (sanfoundry.com)

50. Which of the following are JavaScript optimizers?

Question 50 of 50 (sanfoundry.com)


 

Topic wise Test Quizzes on JavaScript

JavaScript tests, quizzes, and exams are great ways to learn and test your JavaScript skills. Whether you’re a beginner or experienced, challenge and boost your confidence with our engaging online quizzes on JavaScript Basics, Array, Classes, Loops, Objects, Cookies, Events, Graphics, Parsing, and Advanced JavaScript. Start the JavaScript online test now!



JavaScript Certification Test

JavaScript Certification Test is a free certification exam. However, you need to score an A grade in each of the "Certification Level Tests 1 to 10" to be eligible to take part in this certification test. So, take all the "10 Tests" starting from Certification Level 1 upto Level 10, before taking the final Certification test.


Level 1 to 10 Tests:
Total Questions: 25, Total Time: 30 min, Correct Answer: 2 points, Wrong Answer: -1 point

Certification Test:
Total Questions: 50, Total Time: 1 hour, Correct Answer: 2 points, Wrong Answer: -1 point

JavaScript Internship Test

If you scored either Grade A* or Grade A in our JavaScript Internship Test, then you can apply for Internship at Sanfoundry in JavaScript.


Total Questions: 50, Total Time: 1 hour, Correct Answer: 2 points, Wrong Answer: -1 point

JavaScript Job Test

It is designed to test and improve your skills for a successful career, as well as to apply for jobs.


Total Questions: 50, Total Time: 1 hour, Correct Answer: 2 points, Wrong Answer: -1 point

Note: Before you get started on these series of online tests, you should practice our collection of 1000 MCQs on JavaScript .

Sanfoundry Scoring & Grading System

Sanfoundry tests and quizzes are designed to provide a real-time online exam experience. Here is what you need to know about them.

  • Scoring System: You get 2 points for each correct answer but lose 1 point for every wrong answer.
  • Grading System: Your grade depends on your final score and can be one of the following:

    • Grade A* - Genius (100%)
    • Grade A - Excellent (80% to 99%)
    • Grade B - Good (60% to 80%)
    • Grade C - Average (40% to 60%)
    • Grade D - Poor (0% to 40%)
advertisement
advertisement
Manish Bhojasia – Founder & CTO at Sanfoundry

I’m Manish, Founder & CTO at Sanfoundry, with 25+ years of experience across Linux systems, SAN technologies, advanced C programming, and building large-scale, performance-driven learning and certification platforms focused on clear skill validation.

LinkedIn  ·  YouTube MasterClass  ·  Telegram Classes  ·  Career Guidance & Conversations