Javascript Questions and Answers

Take Exam

JavaScript questions with answers help web development students and IT professionals strengthen their coding fundamentals. Commonly asked in placement exams and interviews by companies like TCS, Infosys, and Wipro, these programming questions cover syntax, DOM manipulation, event handling, and ES6 features. Practicing JavaScript programming questions and answers enhances logical thinking and coding accuracy. These exercises are perfect for anyone aiming to master web technology and ace technical interviews with confidence.

Javascript

Showing 10 of 78 questions

61. <script type="text/javascript" language="javascript"> var qpt = "QualityPointTechnologies"; var result =qpt.substring(7,8); document.write(result); </script>

  • Po
  • yP
  • oi
  • P
Show Answer Report

62. How do you delete an element from an options array?

  • Set it to false.
  • Set it to null.
  • Set it to undefined.
  • Set it to -1
Show Answer Report

63. Is javaScript case sensitive ?

  • Yes
  • No
Show Answer Report

64. JavaScript RegExp Object has modifier 'i' to __________

  • Perform case-sensitive matching
  • Perform case-insensitive matching
  • Perform both case-sensitive&case-insensitive matching
Show Answer Report

65. What are the following looping structures are available in javascripts?

  • for,forecach
  • foreach,whileloop
  • do-while loop,foreach
  • for , while loop
Show Answer Report

66. Which of these is not a method of the Math object?

  • atan()
  • atan2()
  • eval()
  • acos()
Show Answer Report

67. <script type="text/javascript"> var s = "9123456 or 80000?"; var pattern = /\d{4}/; var output = s.match(pattern); document.write(output); </script>

  • 9123
  • 91234
  • 80000
  • None of the above
Show Answer Report

68. In javascript, RegExp Object Method test() is used to search a string and returns _________

  • true or false
  • found value
  • index
  • None of the above
Show Answer Report

69. What property would you use to redirect a visitor to another page?

  • document.URL
  • window.location.href
  • .document.location.href
  • link.href
Show Answer Report

70. a.) var qpt="Quality Point Technologies"; b.) var qpt=new String("Quality Point Technologies"); Question: In javascript, which of the above statement can used for string declaration ?

  • Either (a) or (b)
  • Only (a)
  • Neither (a) nor (b)
  • Only (b)
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test