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

31. Choose the four symbol pairs that represent RegExp properties lastMatch, lastParent, leftContext, and rightContext, respectively:

  • $&, $+, $`, $'
  • $+, $&, $', $`
  • $&, $~, $`, $'
  • $+, $&, $`, $'
Show Answer Report

32. Which of the following properties hold the values of the pixels of the length of the width and height of the viewer's screen resolution?

  • screen.width and screen.height
  • Resolution.width and Resolution.height
  • screen.pixels.width and screen.pixels.height
  • ViewerScreen.width and ViewerScreen.height
Show Answer Report

33. ParseInt("15",10)=?

  • 15
  • 10
  • 151
  • 150
Show Answer Report

34. Which JavaScript feature uses JAR files?

  • Object signing
  • Style sheets
  • Netcaster channels
  • Image rollovers
Show Answer Report

35. How to assign a function to a variable with the JavaScript Function contructor ?

  • var f=Function("x","y","return x+y");
  • var f=Function(x,y){ return x+y;}
  • var f= new Function("x", "y", "return x + y");
Show Answer Report

36. In JavaScript, Window.alert() is used to allow user to enter something

  • True
  • False
  • None of above
Show Answer Report

37. <script language="javascript"> function x() { var qpt = "We are fast growing Software Company located in Chennai, India."; var pattern = new RegExp("in","gi"); 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

38. Is Javascript has any date data type?

  • Yes
  • No
Show Answer Report

39. Math. round(-20.5)=?

  • -21
  • 20
  • -20
  • 21
Show Answer Report

40. ?_name is it valid javascript identifier?

  • Yes
  • No
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test