Javascript Questions and Answers
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
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
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
74. -------------- method is used to remove focus from the specified object.
- blur()
- focus()
- None
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