Javascript Questions and Answers

Practice Mode
Showing 10 of 78 questions
Q11
Are java and javascript the same?
  • A NO
  • B YES
Answer: Option A
Q12
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 (a) only
  • B (b) only
  • C Both (a) and (b)
  • D None of the above
Answer: Option C
Q13
<script language="javascript"> function x(z,t) { alert(x.length); } </script> output: ?
  • A Error
  • B 2
  • C 1
  • D 3
Answer: Option B
Q14
What is mean by "this" keyword in javascript?
  • A It refers current object
  • B It referes previous object
  • C It is variable which contains value
  • D None of the above
Answer: Option A
Q15
In JavaScript, Window.prompt() method return true or false value ?
  • A False
  • B True
  • C None of above
Answer: Option A
Q16
Math. round(-20.51)=?
  • A 20
  • B -21
  • C 19
  • D None
Answer: Option B
Q17
<script language="javascript"> function x() { var s = "Quality 100%!{[!!"; var pattern = /\w/g; var output = s.match(pattern); document.write(output); } </script>
  • A %,!,{,[,!,!
  • B Q,u,a,l,i,t,y,1,0,0
  • C Quality 100
  • D Error
Answer: Option B
Q18
<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>
  • A Error
  • B QualityPointTechnologies
  • C WebDevelopment
  • D WebDevelopmnet,ApplicationDevelopment,Testing,QualityPointTechnologies
Answer: Option B
Q19
Choose the server-side JavaScript object:
  • A FileUpLoad
  • B Function
  • C File
  • D Date
Answer: Option C
Q20
parseFloat(9+10)=?
  • A 19
  • B 910
  • C None
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test