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

71. <script type="text/javascript" language="javascript"> var qpt = "QualityPointTechnologies"; var result =qpt.indexOf("Tech"); document.write(result); </script>

  • 11
  • 12
  • 15
  • 13
Show Answer Report

72. <script language="javascript"> function x() { var s = "Eat to live, but do not live to eat"; var pattern = new RegExp("eat$"); document.write(pattern.exec(s)); } </script>

  • Eat
  • eat
  • undefined
  • Eat eat
Show Answer Report

73. <script language="javascript"> function x() { var qpt = "We are fast growing Software Company located in Chennai, India."; var pattern = new RegExp("in","g"); document.write(pattern.exec(qpt) + " "); document.write(pattern.exec(qpt) + " "); document.write(pattern.exec(qpt) + " "); } </script>

  • in in In
  • in in in
  • in in null
  • in null null
Show Answer Report

74. -------------- method is used to remove focus from the specified object.

  • blur()
  • focus()
  • None
Show Answer Report

75. parseFloat("FF2")=?

  • 152
  • FF2
  • NaN
  • None
Show Answer Report

76. eval((20*4)=?

  • Nan
  • 204
  • 24
  • 80
Show Answer Report

77. <script language="javascript"> function x() { var qpt = "QualityPointTechnologies"; var pattern = new RegExp("TECHNOLOGIES","i"); document.write(qpt.match(pattern)); } </script>

  • null
  • Technologies
  • TECHNOLOGIES
  • Error
Show Answer Report

78. Javascript is a ________ typed language.

  • tightly
  • loosely
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test