Javascript Test
Javascript Test
HSBC
=========================================================================================================
======================================================
Test- 2
Name:
Emp ID:
Duration: 60 Min.
Date:10.08.2012
Max Marks: 30
1.
<script type="text/javascript">
x = 4+"4";
document.write(x);
</script>
What is output?
a)44
b)8
c)4
d)Error output
2.
<script type="text/javascript" language="javascript">
var x ="This is a test";
var result = x.split(" ");
document.write(result);
</script>
a)This
b)This is a test
c) This,is,a,test
d)This is
3.
<script type="text/javascript" language="javascript">
document.write(navigator.appCodeName);
</script>
a)get code name of the browser of a vistor
1 of 9
HSBC internal
HSBC
=========================================================================================================
======================================================
a) <js>
b) <scripting>
c) <script>
d) <javascript>
HSBC internal
HSBC
=========================================================================================================
======================================================
11. How do you write a conditional statement for executing some code if
"i" is equal to 5?
a) if i==5 then
b) if (i==5)
c) if i=5
3 of 9
HSBC internal
HSBC
=========================================================================================================
======================================================
d) if i=5 then
12. How do you write a conditional statement for executing some code if
"i" is NOT equal to 5?
a) if (i != 5)
b) if <>5
c) if (i <> 5)
d) if =! 5 then
13.Whay is mean by this keyword in javascript?
a) It refers current object
b) It refers previous object
c) It is variable which contains value
d) None of the above
14.In JavaScript,window.prompt() method return true or false value?
a) False
b) True
c) None of above
HSBC internal
HSBC
=========================================================================================================
======================================================
document.write(qpt);
</script>
a) hello
b) bye
HSBC internal
HSBC
=========================================================================================================
======================================================
d) 5
HSBC internal
HSBC
=========================================================================================================
======================================================
b) loosely
28) parseFloat(9+10)=?
a) 19
7 of 9
HSBC internal
HSBC
=========================================================================================================
======================================================
b) 910
c) None
HSBC internal
HSBC
=========================================================================================================
======================================================
9 of 9
HSBC internal