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

11. Are java and javascript the same?

  • NO
  • YES
Show Answer Report

12. Syntax for creating a RegExp object: var txt=new RegExp(pattern,attributes); var txt=/pattern/attributes; Which of the above mentioned syntax will correct?

  • (a) only
  • (b) only
  • Both (a) and (b)
  • None of the above
Show Answer Report

13. <script language="javascript"> function x(z,t) { alert(x.length); } </script> output: ?

  • Error
  • 2
  • 1
  • 3
Show Answer Report

14. What is mean by "this" keyword in javascript?

  • It refers current object
  • It referes previous object
  • It is variable which contains value
  • None of the above
Show Answer Report

15. In JavaScript, Window.prompt() method return true or false value ?

  • False
  • True
  • None of above
Show Answer Report

16. Math. round(-20.51)=?

  • 20
  • -21
  • 19
  • None
Show Answer Report

17. <script language="javascript"> function x() { var s = "Quality 100%!{[!!"; var pattern = /\w/g; var output = s.match(pattern); document.write(output); } </script>

  • %,!,{,[,!,!
  • Q,u,a,l,i,t,y,1,0,0
  • Quality 100
  • Error
Show Answer Report

18. <script type="text/javascript" language="javascript"> var qpt= new Array(); qpt[0] = "WebDevelopment"; qpt[1]="ApplicationDevelopment" qpt[2]="Testing" qpt[3] = "QualityPointTechnologies"; document.write(qpt[0,1,2,3]); </script>

  • Error
  • QualityPointTechnologies
  • WebDevelopment
  • WebDevelopmnet,ApplicationDevelopment,Testing,QualityPointTechnologies
Show Answer Report

19. Choose the server-side JavaScript object:

  • FileUpLoad
  • Function
  • File
  • Date
Show Answer Report

20. parseFloat(9+10)=?

  • 19
  • 910
  • None
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test