JavaScript MCQ

JavaScript MCQ

  • Admin
  • 03rd Feb, 2023

Take JavaScript MCQ Quiz & Online Test to Test Your Knowledge 

We have listed below the best JavaScript MCQ Questions, that check your basic knowledge of JavaScript. This JavaScript MCQ Test contains 25+ multiple-choice questions. You have to select the right answer to every question to check your final preparation. apart from this, You can also download below the JavaScript MCQ Pdf completely free.

Also, Read the Best JavaScript Interview Questions.

JavaScript MCQ with Answers

1) In which element we put javascript?

  • A. <javascript>
  • B.<scripting>
  • C.<script>
  • D.None of These

2) The correct place to insert a JavaScript is ?

  • A. The <head> section
  • B.The < body> section
  • C.Both 1 & 2
  • D.none of these

3) Which of the following is the correct syntax for referring to an external script called "xxx.js"?

  • A. <script src="xxx.js">
  • B.<script src="xxx.js">
  • C.<script name="xxx.js">
  • D.None of These

4) How we write "Hello World" in an alert box?

  • A. alertBox("Hello World");
  • B.msgBox("Hello World");
  • C.msg("Hello World");
  • D.alert("Hello World");

5) Which of the following is an IF statement in JavaScript?

  • A. if i = 5
  • B.if i = 5 then
  • C.if (i == 5)
  • D.All of these
Download Free : JavaScript MCQ PDF

6) Which of the following is the correct statement of WHILE loop start?

  • A. while (i <= 10)
  • B.while (i <= 10; i++)
  • C.while i = 1 to 10
  • D.None of These

7) Which of the following is the correct statement for comment in a JavaScript?

  • A. //This is a comment
  • B./*This is a comment*/
  • C.$This is a comment$
  • D.None of These

8) Is JavaScript is the same as Java?

  • A. Yes
  • B.No

9) ____________operator is used to assign a value to a variable?

  • A. *
  • B.x
  • C.=
  • D.+

10) JavaScript is case-sensitive. True or False?

  • A. True
  • B.False

11) Which of the following event occurs when the user clicks on an HTML element?

  • A. onmouseclick
  • B.onmouseover
  • C.onclick
  • D.None

12) Javascript was designed for which of the following purposes

  • A. To Style HTML Pages
  • B.To Perform Server Side Scripting Opertion
  • C.To add interactivity to HTML Pages
  • D.To Execute Query Related to DB on Server

13) Which of the following attribute is used to specify the character encoding used in an external script file?

  • A. type
  • B.charset
  • C.character
  • D.All of the above

14) Executable single line of Script is called as _________________.

  • A. Breakpoint in JS
  • B.Statement in JavaScript
  • C.Line in JS
  • D.None of the above

15) Which of the following option terminates Java Statement?

  • A. Semicolon
  • B.Full Stop
  • C.Comma
  • D.Slash

16) _________ statement is used to declare variable in JavaScript.

  • A. Executable Statement
  • B.Declaration Statement
  • C.Conditional Statement
  • D.Assignment Statement

17) ______ operator is used to concatenate two strings.

  • A. Dot
  • B.Arrow
  • C.Comma
  • D.Plus

18) Which of the following operator contains JavaScript that assigns a value to a variable based on some condition?

  • A. Assignment operator
  • B.Bitwise Operator
  • C.Conditional operator
  • D.Logical Operator

19) Which of the following function of Boolean object returns the primitive value of the Boolean object?

  • A. toString()
  • B.toSource()
  • C.valueOf()
  • D.None of These

20) Which of the following is a server-side Java Script object?

  • A. FileUpload
  • B.Date
  • C.Function
  • D.File

21) Which of the following is the correct syntax to display "OnlineInterviewQuestions" in an alert box using JavaScript?

  • A. alert("OnlineInterviewQuestions");
  • B.confirm("OnlineInterviewQuestions");
  • C.msgbox("OnlineInterviewQuestions");
  • D.None of the above

22) Which of the following is correct about features of Javascript?

  • A. It can not Handling dates and time.
  • B.JavaScript is a object-based scripting language.
  • C.JavaScript is not interpreter based scripting language.
  • D.None of the above

23) What are variables used for in Javascript programs?

  • A. Varying randomly
  • B.Storing numbers, dates, or other values
  • C.Causing high-school algebra flashbacks
  • D.None of the above

24) Spaces,Punctuation marks are called as __________ Symbols in JavaScript.

  • A. Special
  • B.Punctual
  • C.Mandetory
  • D.None of these

25) The external JavaScript file must contain <script> tag.

  • A. True
  • B.False

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

Unix MCQ
Corel Draw MCQ
Scala MCQ