JavaScript MCQs with answers Page - 32

Here, you will find a collection of MCQ questions on JavaScript. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833K Points
Coach

Q. Which is not valid data type in Javascript

  • (A) Undefinded
  • (B) Boolean
  • (C) float
  • (D) Number

A

Admin • 833K Points
Coach

Q. Which type of language is Javascript

  • (A) Programming
  • (B) Scripting
  • (C) Markup
  • (D) None of the above

A

Admin • 833K Points
Coach

Q. By which javascript code is used

  • (A) Classes
  • (B) Methods/Functions
  • (C) RMI
  • (D) Events

A

Admin • 833K Points
Coach

Q. Which tag is used to write the javascript code

  • (A) <script>
  • (B) <sp>
  • (C) <javascript>
  • (D) <java>

A

Admin • 833K Points
Coach

Q. Which of the following function of String object causes a string to be italic, as if it were in an <i> tag?

  • (A) fontsize()
  • (B) fontcolor()
  • (C) fixed()
  • (D) italics()

A

Admin • 833K Points
Coach

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

Code:
<script type="text/javascript"> 
var a="Tanmay"; 
var x=a.lastIndexOf("a"); 
document.write(x); 
</script>
  • (A) 4
  • (B) 5
  • (C) 1
  • (D) 2

A

Admin • 833K Points
Coach

Q. Purpose of designing the Javascript

  • (A) To Perform Server Side Scripting Opertion
  • (B) To add interactivity to HTML Pages
  • (C) To Style HTML Pages
  • (D) All of the above

A

Admin • 833K Points
Coach

Q. Which of the following function of Array object removes the last element from an array and returns that element?

  • (A) push()
  • (B) delete()
  • (C) pop()
  • (D) link()

A

Admin • 833K Points
Coach

Q. A Javascript developed in Unix machine

  • (A) will throw errors and exceptions
  • (B) must be restricted to a Unix Machine only C.
  • (C) will be displayed as a JavaScript text on the browser
  • (D) will work perfectly well on a Windows Machine

A

Admin • 833K Points
Coach

Q. What will be the output of following JavaScript Code?

Code:
<script type="text/javascript" language="javascript"> 
  
var a = "Tanmay Acarya"; 
var result = a.substring(4, 5); 
document.write(result); 
  
</script> 
  • (A) a
  • (B) y
  • (C) n
  • (D) c

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ