0% found this document useful (0 votes)
70 views

(B) University "JNTUOSMANIA"

This document contains 30 multiple choice questions about JavaScript concepts, syntax, and usage. The questions cover topics like data types, operators, arrays, functions, conditional statements, loops, linking external scripts, and using JavaScript in HTML.

Uploaded by

davidrajhivc
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

(B) University "JNTUOSMANIA"

This document contains 30 multiple choice questions about JavaScript concepts, syntax, and usage. The questions cover topics like data types, operators, arrays, functions, conditional statements, loops, linking external scripts, and using JavaScript in HTML.

Uploaded by

davidrajhivc
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

1)I n J avaS c r i p t , f or n e s t i n g t h e s t ri n g s J N T U an d O S M A N I A on e i n s i d e an o t h e r a n d p u t i n U n i ve r s i ty, th e c o r re c t s t at e m e nt i s ( a) u n i ve r s i ty = J N T U + OS M A N I A ( b ) u n i ve r s i ty = J N T U OS M A N I A ( c ) u n i ve r s i ty = J N T U O S M A N I A ( d ) u n i ve r s i ty = J N T U O S M A N I A 2)c o m m an d d i s p l ays a s i m p l e w i n d ow t h a t c o nt ai n s a p r o m p t a n d a t e x tfi e l d i n w h i ch t h e u s e r c an e nt e r d a ta . ( a) c o n fi r m ( s t r i n g ) ( b ) p r om p t ( s tr i n g , s tr i n g ) ( c ) a l e r t( s t r i ng ) ( d ) p r om p t ( s tr i n g ) 3)I n d i s p l ay i n g t h e f r a m e s th e s c r e e n c a n b e s p l i t . ( a) p a ra l l e l y ( b ) c a n n ot b e s p l i t ( c ) d i a go n al l y ( d ) h o ri z ont al l y 4)I n J ava S c r i p t , t o e x t ra c t a r a n ge of e l e m e nt s f r om an ar r ay t h e f u n c t i on i s .

( a) p u s h ( ) (b) slice() (c) shift() ( d ) r e ve r s e ( )

5)i s th e p r o c e s s of e n s u r i n g t h at u s e r s s u b m i t on l y t h e s e t o f ch ar ac te rs w h i ch yo u r e q u i r e . ( a) D at a d e l e ti o n ( b ) D at a val i d a ti o n ( c ) D at a ch e ck i n g ( d ) D at a c o r r e c t i on

6)c a l l s a f un c ti o n w h e n t h e c u rs or m ove s away f r o m t h e i m a g e . ( a) o n m ou s e rove r ( b ) o n s u b m i t ( c ) o n m ou s e ou t ( d ) o n l oa d

7)c o n s i d e r t h e s c r i p t va r fi r s t = A S t ri n g i s va r s e c on d = a d d e d t o t h e e n d fi r s t += s e c o n d ; T h e c ont e nt s o f th e va r i ab l e fi r s t i s ( a) S t r i n g i s a d d e d t o t h e e nd ( b ) a d d e d t o t h e e n d ( c ) a d d e d t o t h e e n d A S t r i n g i s ( d ) A s tr i n g i s 8)I n J ava S c r i p t , t o i n s e r t s a l i s t of e l e m e nt s ont o t h e f r o nt of t h e a r ray, t h e f u n c t i on i s . ( a) s h i f t ( ) ( b ) s l i c e ( ) ( c ) p u s h ( ) ( d ) u n s h i f t ( ) 9)W h a t i s t h e t ag u s e d t o e mb e d t h e mu l t i m e d i a o b j e c t s d i r e c t l y i nt o t h e we b page? ( a) h r e f ( b ) i nclude (c) link (d) object 10)T h e f u n c t i on t h at r e t u r n s th e ch ar a c t e r w h i ch i s a t p o s i t i on i n d e x i n t h e s t ringis. ( a) ch a rAt ( ) ( b ) ch a rAt ( i n d e x ) ( c ) ch a r( i n d e x ) ( d ) ch a rO ff ( i n d e x ) 11)J avaS c ri p t ha s nu mb e r o f ty p e s of op e r at o rs . ( a) 1 ( b ) 2 ( c ) 3 ( d ) 4

12)I n J ava S c r i p t , t o i n s e r t s a l i s t of e l e m e nt s ont o t h e f r o nt of t h e a r ray, t h e f u n c t i on i s .

( a) s l i c e ( ) ( b ) p u s h ( ) ( c ) s h i f t ( ) ( d ) u n s h i f t ( ) 13)J avaS c ri p t h a s on l y f ou r ty p e s of d at a . T h e y ar e . ( a) nu m e r i c , ch a r ac t e r , s t ri n g , B o o l e a n ( b ) i nt e ge r, fl oa t , s t r i n g, B o o l e an ( c ) nu m e r i c , s t r i n g , B o o l e a n , nu l l ( d ) i nt e ge r, fl oa t , ch a ra c t e r , B o o l e a n

14)T h e J avaS c r i p nu m e r i c a l c o n s t a nt M at h . E i s a p p r ox i m at e l y ( a) 2 . 71 8 ( b ) 3 . 71 8 ( c ) 3 . 14 8 ( d ) 2 . 14 8 15) c a l l s a j ava s c r i p t f u n c ti o n w he n t h e c u rs or p a s s e s t h e ove r t h e i m a ge .

( a) o n s u b m i t ( b ) o n m ou s e rove r ( c ) o n l oa d ( d ) o n m ou s e ou t 16) i s th e p r o c e s s of e n s u r i n g t h at u s e r s s u b m i t on l y t h e s e t o f ch ar ac te rs w h i ch yo u r e q u i r e . ( a) D at a c o r r e c t i on ( b ) D at a ch e ck i n g ( c ) D at a val i d a ti o n ( d ) D at a d e l e ti o n 17) I n J ava S c r i p t , t h e f u n c t i on w h i ch r e m ove s t h e l a s t e l e m e nt f r om th e ar r ay is.

( a) c o n c a t( ) (b) shift() (c) join() (d) pop() 18) I n J ava S c r i p t , va r i ab l e s a r e d e c l ar e d u s i n g th e ke y wo r d . ( a) va r i ab l e ( b ) va r ch ar ( c ) va r ( d ) va r i ant 19) Inside which HTML element do we put the JavaScript? <scripting> <script> <js> <javascript> 20) What is the correct JavaScript syntax to write "Hello World"? response.write("Hello World") document.write("Hello World") "Hello World" ("Hello World") 21) Where is the correct place to insert a JavaScript? The <head> section The <body> section Both the <head> section and the <body> section are correct

22) What is the correct syntax for referring to an external script called "xxx.js"? <script type="text/javascript" name="xxx.js"> <script type="text/javascript" href="xxx.js"> <script type="text/javascript" src="xxx.js"> 23) How do you write "Hello World" in an alert box? alertBox="Hello World" alertBox("Hello World") msgBox("Hello World") alert("Hello World") 24) How do you write a conditional statement for executing some code if "i" is equal to 5? if (i==5) if i==5 then if i=5 then if i=5 25) How does a "while" loop start? while (i<=10) while i=1 to 10 while (i<=10;i++) 26) How does a "for" loop start? for (i <= 5; i++) for i = 1 to 5 for (i = 0; i <= 5; i+ +) for (i = 0; i <= 5) 27) Which year javascript introduce 1988 1985

1986 1984 28)who was introduce javascript Netscape microsoft microsoft solu dennisritch 29) What is the correct HTML for referring to an external style sheet? <link rel="stylesheet" type="text/css" href="mystyle.css"> <stylesheet>mystyle.css</stylesheet /> <style src="mystyle.css" /> 30) Where in an HTML document is the correct place to refer to an external style sheet? At the end of the document In the <head> section In the <body> section At the top of the document

You might also like