Javascript Question and Answer
Javascript Question and Answer
21. <script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script>
function x()
{
document.write(2+5+"8");
}
</script>
- 258
- Error
- 7
- 78
23. In Javascript, Which of the following method is used to evaluate the regular expression?
- eval(2*(3+5))
- evaluate(2*(3+5))
- evalu(2*(3+5))
- None of the above
24. <script language="javascript">
function x()
{
var s= "quality 100%";
var pattern = /\d/g;
var output= s.match(pattern);
document.write(output);
}
</script>
function x()
{
var s= "quality 100%";
var pattern = /\d/g;
var output= s.match(pattern);
document.write(output);
}
</script>
- 100
- 1,0,0
- q,u,a,l,i,t,y,%
- Error
25. <script type="text/javascript" language="javascript">
qpt=((45%2)==0)? "hello" : "bye";
document.write(qpt);
</script>
qpt=((45%2)==0)? "hello" : "bye";
document.write(qpt);
</script>
- hello
- bye
- Error in string handling
- None of the above
26. <script language="javascript">
function x()
{
var qpt = "QualityPointTechnologies";
var pattern = new RegExp("POIiNT","i");
document.write(qpt.match(pattern));
}
</script>
function x()
{
var qpt = "QualityPointTechnologies";
var pattern = new RegExp("POIiNT","i");
document.write(qpt.match(pattern));
}
</script>
- Error
- POIiNT
- Point
- null
27. How do you create a new object in JavaScript?
- var obj = {};
- var obj = Object();
- var obj=new {};
- None of the above
28. In Javascript, What does isNaN function do ?
- Return true if the argument is not a number.
- Return false if the argument is not a number.
- Return true if the argument is a number.
- None of the above