67% found this document useful (3 votes)
24K views

Javascript MCQ

The document discusses JavaScript, including its history, uses, syntax, data types, and comparison to other programming languages. Some key points covered include: - JavaScript is a client-side scripting language that is commonly used to add interactivity to web pages. It was created in 1995 and released in 1996. - JavaScript's syntax is based on C and C++ but it is a prototype-based, multi-paradigm scripting language that is dynamic, weak typed, and has first-class functions. - Core JavaScript data types include numbers, strings, Booleans, objects, functions, symbols, and null/undefined. - JavaScript code can be added directly in HTML files or separated

Uploaded by

prvijesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
67% found this document useful (3 votes)
24K views

Javascript MCQ

The document discusses JavaScript, including its history, uses, syntax, data types, and comparison to other programming languages. Some key points covered include: - JavaScript is a client-side scripting language that is commonly used to add interactivity to web pages. It was created in 1995 and released in 1996. - JavaScript's syntax is based on C and C++ but it is a prototype-based, multi-paradigm scripting language that is dynamic, weak typed, and has first-class functions. - Core JavaScript data types include numbers, strings, Booleans, objects, functions, symbols, and null/undefined. - JavaScript code can be added directly in HTML files or separated

Uploaded by

prvijesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Module 13

JAVASCRIPT
1. JavaScript is a ....
A. static computer programming language B. Structured query programming language
C. dynamic computer programming language D. Procedural oriented programming language
2. Which one of the following is not server-side scripting language
A. PHP B. Pearl C. Python D. Javascript
3. JavaScript is a
A. client-side scripting language B. Server-side scripting language
C. structured query language D. Procedural oriented programming language
4. Javascript is mainly used for...
A. creating web browser B. Reading and writing files
C. storing data in the server D. Interaction with the user through web page
5. Who was developed JavaScript?
A. Brendan Eich B. BjameStroustrup C. Dennis M. Ritchie D. Brian W. Kernighan
6. In which year JavaScript was developed?
A. 1985 B. 1975 C. 1995 D. 1998
7. JavaScript‟s syntax was influence by....
A. C programming language B, procedure oriented language
C. prototype-based scripting language D. Event-driven programming language
8. JavaScript initially called as......
A. PHP B. Perl C. J Script D. Live Script
9. Which language‟s syntax was used in JavaScript?
A. C B. SQL C. COBOL D. Visual Basic
10. Which one is responsible to run JavaScript code?
A. Browser B. Compiler C. Interpretar D. Operating System
11. Which one of the following cannot be used to edit JavaScript code?
A. MS Excel B. Notepad++ C. Sublime Text D. Visual Studio Code
12. JavaScript is a ....
A. Case sensitive language B. coding sensitive language
C. regular sensitive language D. non-case sensitive language
13. Mocha was officially called ....
A. Ada B. Lisp C. Mucha D. LiveScript
14. What is the extension name of HTML program?
A. .js B. .hml C. .Lisp D. .html
15. It is better to segregate HTML and JavaScript files, so the segregated JavaScript file is called as ....
A. local JavaScript file B. global JavaScript file
C. internal JavaScript file D. external JavaScript file
16. JavaScript is a ....
A. static scripting language B. regular sensitive language
C. object based scripting language D. object oriented scripting language
17. What are the benefits to segregate HTML and JavaScript files?
A. It is easier to modify code B. The execution speed of program will be increased
C. The execution speed of program will be decreased
D. Changing HTML files will not affect JavaScript files
18. The extension file name of the external JavaScript file is ....
A. .js B. .ext C. .html D. .jext
19. We can import the JavaScript code file in HTML using ...
A. src attribute in script tag B. Ink attribute in script tag
C. link attribute in script tag D. jsLink attribute in script tag
20. Which one of the following is text editor?
A. Excel B. Word C. Notepad D. WordPad
21. Which method creates the following popup box in JavaScript?

A. Alert method B. Show method C. Prompt method D. Confirm method


22. JavaScript is a
A. case sensitivity language B. coding sensitive language
C. regular sensitivity language D. non-case sensitive language
23. The variable name must be a...
A. keyword B. reserved word C. undefined word D. user-defined word
24. JavaScript gives the user
A. more control over the OS B. more control over the server
C. more control over the browser D. more control over the computer
25. Which character is used to terminate the JavaScript statement?
A. / B. ; C. # D. @
26. JavaScript control statements syntax is same as syntax of control statements in..
A. C language B. Java Language C. COBOL Language D. Visual Basic Language
27. Which one of the following is a disadvantage of JavaScript?
A. Security issues B. Fast to the end user C. Executed on the client side
D. instance response to the visitors
28. Which one of the following is an advantage of JavaScript?
A. Security issues B. No multi threading capabilities
C. Instance response to the visitors D. JavaScript does not allow us to read or write files
29. Variables can be ...
A. numbers B. mix of special symbols and numbers
C. mix of lower and upper case characters D. mix of lower, upper case characters and numbers
30. The first character of an identifier is...
A. * B. ^ C. / D. _
31. What is the full form of ECMA?
A. European Computer Manufacturing Association
B. European Computer Manufacturers Association
C. European Calculator Manufacturers Association
D. European Component Manufacturers Association
32. What is the latest official version of JavaScript?
A. ECMA Script (ES4) B. ECMA Script (ES5)
C. ECMA Script (ES5.1) D. ECMA Script 2018
33. How many sections are there in a HTML program?
A.3 B. 5 C. 1 D. 2
34. Where the JavaScript code can be added?
A. In the body section B. In the head section
C. In the both section D. Outer of the html tag
35. What is the fullform of HTTP?
A. Hyper Text Transport Protocol B. Hyper Text Transfer Protocol
C. HyperText Transmission Protocol D. HyperText Transportable Protocol
36. Web Server is a
A. Computer B. Program C. hardware D. firmware
37. What i the fullform of XML?
A. Extensible Mark Language B. ExtentendMarkup Language
C. Extensible Markup Language D. Extensible Markingup Language
38. Web hosting requires...
A. Servers B. hardware C. web servers D. web address
39. A Internet unique address which contains a series of
A. 4 numbers B. 3 numbers C. 2 numbers D. 5 numbers
40. Multiple domains (users) managed by
A. FTP B. HTTP C. server D. hosting providers
41. A web host is a ...
A. server B. Internet C. company D. web server
42. Which one of the following is an event handler?
A. Math B. Date C. String D. onClick
43. The classifying and identifying one of the various types, such as real, integer or Boolean, that
determines the possible values for that type is called as ...
A. data type B. memory type C. hardware type D. character type
44. The following one is not a web server
A. IIS B. Linux C. Nginx D. Apache
45. Apache web server is a
A. malware B. firmware
C. shareware D. open source software
46. KOLKATA is one of the following data type
A. Null B. Strings C. Boolean D. Numbers
47. True is one of the following data type
A. Null B. Strings C. Boolean D. Numbers
48. JavaScript Floating Point numbers are always using
A. 24 bit b. 32 bit C. 64 bit D. 128 bit
49. -51.50 is one of the following data type
A. Null B. Strings C. Boolean D. Numbers
50. Which function is used to check whether a number value or not?
A. isNaN() B. isNum() C. isDigit() D. isNumber()
51. JavaScript supports the following
A. char data type B. float data type C. Object data type D. Integer data type
52. Property is a .....
A. Variable B. Object C. Class D. Numbers
53. Apache web server contains
A. normal structure B. modular structure C. non-modular structure
D. predetermined structure
54. Apache web server solves....
A. memory issues B. time sharing issues
C. administrative issues D. batch processing issues
56. What is the fullform of IIS?
A. Internet Information Service B. Intranet Information Services
C. Internal Information Service D. International Information Service
56. IIS is a ....
A. malware B. firmware C. shareware D. open source software
57. Nginx includes
A. skull proxy B. anonymster C. residential IP Proxy D. IMPA/POP3 proxy server
58. A segregated JavaScript code file is called as....
A. local JavaScript file B. global JavaScript file
C. external JavaScript file D. universal JavaScript file
59. The extension name of JavaScript file is
A. .js B. .java C. .html D. .javajs
60. The external JavaScript file is included in HTML file using an attribute called...
A. src B. Ink C. link D. jslink
61. Which keyword is used to declare a variable
A. Var B. VAR C. var D. dim
62. When we execute the following JavaScript code segment, what will be the value of c.
var a=15;
var b=25;
var c=a+b;
A. 15 B. 25 C. 45 D. 40
63. All JavaScript variable must have
A. unique name B. double name C. global name D. multiple name
64. A variable name may consists of ..
A. letters, special symbols B. spaces, letters and numbers
C. letters, digits, underscores, and dollar sign
D. must begin with a number and then letters
65. Which one of the following is a valid variable name?
A. if B. 9Basic_Pay C. $Basic_Pay D. Total Deduction
66. Which character may be the first character of a variable?
A. 6 B. # C. & D. $
67. When we calculate a number outside the largest possible number, JavaScript will return..
A. NaN B. 10000000 C. infinity (pr-Infinity) D. largest -ve or +ve number
68. When a number is divided 0, JavaScript generates..
A. 0 B. NaN C. Infinity D. largest possible number
69. When executing the following JavaScript statement?
var y=-2/0;
The value of y will be
A. 0 B. NaN C. Infinity D. -Infinity
70. Infinity is a ....
A. string B. object C. number D. floating point number
71. Typed (Infinity) returns....
A. string B. Object C. number D. floating point number
72. JavaScript identifiers are ....
A. case sensitive B. regular sensitive C. irregular sensitive D. non-case sensitive
73. The other name of keyword is...
A. logical word B. original word C. reserved word D. relational word
74. NaN is a JavaScript reserved word indicating that a value
A. is a string B. is an object C. is a number D. is not a number
75. Which function is used to find out if a value is not a number?
A. isNaN() B. isString() C. isNumber() D. isNotANumber()
76. What is the value of x when the following statement is executed?
var x=100/”Apple”;
A.100 B. NaN C. 100Apple D. Apple100
77. What is the value of x when the following statement is executed?
var y = 100/”10”;
A. 10 B. NaN C. 10010 D. Infinity
78. What is the value of x when the following statement is executed?
x=isNaN(1000/0);
A. True B. NaN C. False D. Infinity
79. What is the equivalent statement of a=a*?
A. a*=3; B. a=*3; C. a=a*a*a; D. a=a3
80. When executing the following statement,
var y=new Number(123)
The type of y will be...
A. infinity B. math object C. string object D. number object
81. When we execute the following JavaScript code segment, What will be the output?
var x=123;
var y=new Number(123);
If(x===y)
alert(“Yes”);
else
alert(“No”);
A. No B. Yes C. Null D. Infinity
82. When executing the following JavaScript statement, What it would be return?
alert(Number.MAX_VALUE);
A. Represents infinity (returned on overflow)
B. Returns the largest number possible in JavaScript
C. Represents negative infinity (returned on overflow)
D. Returns the smallest number possible in JavaScript
83. When executing the following JavaScript statement, What it would be return?
alert(Number.MIN_VALUE);
A. Represents infinity (returned on overflow)
B. Returns the largest number possible in JavaScript
C. Represents negative infinity (returned on overflow)
D. Returns the smallest number possible in JavaScript
84. When executing the following JavaScript statement, What it would be return?
alert(Number.NEGATIVE_INFINITY);
A. Represents infinity (returned on overflow)
B. Returns the largest number possible in JavaScript
C. Represents negative infinity (returned on overflow)
D. Returns the smallest number possible in JavaScript
85. When executing the following JavaScript statement, What it would be return?
alert(Number.POSITIVE_INFINITY);
A. Represents infinity (returned on overflow)
B. Returns the largest number possible in JavaScript
C. Represents negative Infinity (returned on overflow)
D. Returns the smallest number possible in JavaScript
86. When executing the following JavaScript statement, What it would be return?
alert(Number.NaN);
A. Represents a “Non-a-Number” value
B. Returns the largest number possible in JavaScript
C. Represents negative infinity (returned on overflow)
D. Returns the smallest number possible in JavaScript
87. MAX_VALUE. MIN_VALUE, NEGATIVE_INFINITY, and POSITIVE_INFINITY properties can only
access with
A. math method B. string method C. object method D. Number method
88. When executing the following statement what would be output?
var x=6;
var y=x.MAX_VALUE;
alert(y);
A. NaN B. Infinity C. Undefined D. Largest number
89. The Number() method returns....
A. Returns a string B. Parses its argument and returns an integer
C. Returns a number, converted from its argument
D. Parses its argument and returns a floating point number
90. The parselnt(“123.45”) method returns...
A. Returns a string
B. Parses its argument and returns an integer
C. Returns a number, converted from its argument
D. Parses its argument and returns a floating point number
91. The parseFloat(“123.45”) method returns...
A. Returns a string
B. Parses its argument and returns an Integer
C. Returns a number, converted from its argument
D. Parses its argument and returns a floating point number
92. What would be output of the following JavaScript code executed?
alert(123) toString());
A. 123 B. NaN C. “123” D. Infinity
93. What would be output of the following JavaScript is executed?
alert((100+23) .toString());
A. “100” B. “23” C. 123 D. “10023”
94. What would be output of the following JavaScript code executed?
var x=9.656;
alert(x.toExponential(2));
A. 9.6e+1 B. 9.66+0 C. 9.65e+0 D. 9.66e+0
95. What would be output of the following JavaScript code executed?
varx=9.656;
alert(x.toExponential(4));
A.9.6e+1 B. 9.656e+0 C. 9.656e+0 D. 9.656758e+0
96. What would be output of the following JavaScript code executed?
var x=9.656758;
alert(x.toExponential());
A. 9.66e+1 B. 9.656e+0 C. 9.6567e+1 D. 9.656758e+0
97. What would be output of the following JavaScript code executed?
var x =9.656;
alert(x.toFixed(0));
A. 9 B. 9.6 C. 9.7 D. 10
98. What would be output of the following JavaScript code executed?
var x=9.656;
alert(x.toFixed(6));
A. 9.66 B. 9.656 C. 9.65600 D. 9.656000
99. What would be output of the following JavaScript code executed?
var x=9.656;
alert(x.toFixed(2));
A. 9.65 B. 9.66 C. 9.656 D. 9.6560
100. What would be output of the following JavaScript code executed?
var x=9.656;
alert(x.toPrecision());
A. 9.65 B. 9.66 C. 9.656 D. 9.6560
101. What would be output of the following JavaScript code executed?
var x=9.656;
alert(x.toPrecision(2));
A. 9.7 B. 9.65 C. 9.656 D. 9.6560
102. What would be output of the following JavaScript code executed?
var x-9.656;
alert(x.toPrecision(4));
A. 9.65 B. 9.66 C. 9.656 D. 9.6560
103. What would be returned when the following JavaScript code is executed?
var x=”123”;
alert(x.valueOf(x));
A. Returns an object B. Returns a string literal
C. Returns a number as a string D. Returns a number as a number
104. What would be the output when the following JavaScript code is executed?
var x=true;
alert(Number(x));
A. 1 B. True C. False D. Nothing
105. What would be the output when the following JavaScript code is executed?
var x=false;
alert(Number(x));
A. 0 B. True C. False D. Nothing
106. What would be the output when the following JavaScript code is executed?
var x=”10”;
alert(Number(x));
A. 10 B. “10” C. Null D. NaN
107. What would be the output when the following JavaScript code is executed?
var x= “10 20”;
alert(Number(x));
A. 10 B. “10” C. Null D. NaN
108. What would be the output when the following JavaScript code is executed?
alert(parselnt(“10”);
A. 10 B. “10” C. Null D. NaN
109. What would be the output when the following JavaScript code is executed?
alert(parselnt(“10.33”));
A. 10 B. “10” C. Null D. NaN
110. What would be the output when the following JavaScript code is executed?
alert(parselnt(“10 20 30”));
A. 10 B. “10” C. Null D. NaN
111. What would be the output when the following JavaScript code is executed?
alert(parselnt(“10 years”));
A. 10 B. “10” C. Null D. NaN
112. What would be the output when the following JavaScript code is executed?
alert(parselnt(“years 10”));
A. 10 B. “10” C. Null D. NaN
113. What would be the output when the following JavaScript code is executed?
alert((100+23).valueOf());
A. 123 B. “123” C. Null D. NaN
114. Which escape character represents backspace sequence value?
A. \b B. \t C. \n D. \v
115. Which escape character represents tab sequence value?
A. \b B. \t C. \n D. \v
116. Which escape character represents new line sequence value?
A. \b B. \t C. \n D. \v
117. Which escape character represents vertical tab sequence value?
A. \b B. \t C. \n D. \v
118. Which escape character represents form feed sequence value?
A. \f B. \t C. \r D. \v
119. Which escape character represents carriage return sequence value?
A. \f B. \t C. \n D. \v
120. Which escape character represents literal back slash sequence value?
A. \f B. \t C. \n D. \\
121. Which one is the special keyword, reserved to define a constant?
A. cons B. con C. const D. cont
122. Which data type return the value true or false?
A. String data type B. Object data type C. Boolean data type D. Number data type ss
123. Name the data type, which is a special and it means simply nothing
A. Null B. Object C. Integer C. Undefined
124. Which one represents a variable that has not yet contain a value?
A. Null B. Object C. Integer D. Undefined
125. Name the data type, Which has a collection of properties and related methods in JavaScript?
A. Null B. Object C. Integer D. Undefined
126. Name the derived data type, which is used to store multiple data under a name?
A. Null B. Array C. String D. Undefined
127. Which keyword used to declare a variable?
A. var B. Var C. dim D. declare
128. Which operator can be used to delete properties from objects?
A. Erase B. delete C. del D. remove
129. The variables, which are declared outside the function is called
A. local variable B. static variable C. global variable D. dynamic variable
130. The variables, which are declared inside the function is called
A. local variable B. static variable C. global variable D. dynamic variable
131. A number can be converted to string by calling
A. str()function B. Num()function C. strmg()function D. String()function
132. In JavaScript=operator is an
A. logical operator B. relational operator
C. comparison operator D. assignment operator
133. In switch case which keyword specifies the code to run if there is no case match?
A. break B. case C. end select D. default
134. What would be output of the following JavaScript segment?
var str=”World‟s Hello!”;
var n = str.length;
document.write(n);
A. 12 B. 13 C. 14 D. 15
135. What would be output of the following JavaScript segment?
varstr=”HELLOWORLD”;
var res=str.charAt(0);
document.write(res);
A. O B. E C. H D. D
136. What would be output of the following JavaScript segment?
var str= “HELLOWORLD”;
var n = str.charCodeAt(0);
document.write(n);
A. 60 B. 66 C. 70 D. 72
137. What would be output of the following JavaScript segment?
var str1= “Hello”;
var str2= “world!”;
var res = str1.concat(str2);
document.write(res);
A. world!Hello B. Helloworld! C. world!Hello D. Hello world!
138. What would be output of the following JavaScript segment?
var ch = String fromCharCode(72);
document.write(ch);
A. C B. G C. H D. A
139. What would be output of the following JavaScript segment?
var str = “welcome Hellow world, welcome to the universe”;
var n = str.indexOf(“welcome”);
document.write(n);
A. 0 B. 7 C. 9 D. 14
140. What would be output of the following JavaScript segment?
var str = “Hello world!”;
var res = str.substr(11, 1);
document.write(res);
A. 1 B. ! C. d D. o
141. What would be output of the following JavaScript segment?
var str = “welcome Hello world, welcome to the universe”;
var n = str.lastIndexOf(“welcome”);
document.write(n);
A. 0 B. 9 C. 14 D. 21
142. Which statement to be executed to get the following output?
ello
Assume that str contains “Hello world!”
A. Var res = str.substr(0,4); document.write(res);
B. Var res = str.substr(2,4); document.write(res);
C. Var res = str.substr(3,4); document.write(res);
D. Var res = str.substr(1,4); document.write(res);
143. What will be the output for the following JavaScript code segment?
varstr = “Hello World!”; var res = str.toLowerCase(); document.write(res);
A. hello world! B. hello World!
C. hELLowORLD D. HELLOWORLD!
144. What will be done when following JavaScript code segment executed?
varstr= “ Hello World! “; alert(str.trim());
A. Remove whitespaces from leftside only
B. Remove whitespaces from right side only
C. Remove whitespaces from both sides of the string
D. Remove whitespaces from both sides and inner side of the string
145. How many types of operators are there in?
A. 6 B. 7 C. 8 D. 9
146. When we execute the following JavaScript code segment, What will be the value of c
var a = 15;
var b = a + 25;
var c = a + b;
A. 40 B. 25 C. 56 D. 15
147. What will be the output for the following JavaScript code segment?
var num1=-5;
var num2=-15;
var res=num1-num2;
document.write(res);
A. -5 B. 5 C. 10 D. 25
148. In JavaScript modulo operator returns...
A. divident B. division of division
C. quotient of division D. remainder of division
149. In JavaScript 4%1 returns...
A. 0 B. 1 C. 2 D. 4
150. In JavaScript 1 % 4 returns ......
A. 0 B. 1 C. 2 D. 4
151. When executing following JavaScript code what will be the output?
var num1=2;
var num2= “20”;
var res=num1 * num2;
document.write(res);
A. 0 B. 22 C. 40 D. 220
152. When executing following JavaScript code what will be the output?
var num1 = 2;
var num2= “20”;
var res = num1 / num2 ;
document.write(res);
A. 0.1 N. 2.2 C. 4.0 D. 220
153. Additive and multiplicative operators together can be called as...
A. logical operators B. bitwise operators C. relational operators D. arithmetic operators
154. When executing following JavaScript code what will be the output?
var num1=5;
var num2=1;
var res=num1 & num2;
document.write(res);
A. 1 B. 4 C. 5 D. 10
155, When executing following JavaScript code what will be the output?
var num1 = 5;
var num2 = 1;
var res = num1 | num2;
document.write(res);
A. 1 B. 4 C. 5 D. 10
156. When executing following JavaScript code what will be the output?
var num1=5;
var res=-num1;
document.write(res);
A. 1 B. 4 C. -6 D. 10
157 When executing following JavaScript code what will be the output?
var num1=5;
var num2=1;
var res=num1^num2;
document.write(res);
A. 1 B. 4 C. 5 D. 10
158. When executing following JavaScript code what will be the output?
var num1=5;
var num2=1;
var res=num1<<num2;
document.write(res);
A. 1 B. 4 C. 5 D. 10
159. When executing following JavaScript code what will be the output?
var num1=5;
var num2=1;
var res=num1>>num2;
document.write(res);
A. 1 B. 2 C. 4 D. 5
160. The == operator is used to
A. test whether two expression are equal
B. test whether two expression are not equal
C. test whether two expressions are equal using stricter methods
D. test whether two expressions are not equal using stricter method
161. The !=operator is used to
A. test whether two expression are equal
B. test whether two expression are not equal
C. test whether two expressions are equal using stricter methods
D. test whether two expressions are not equal using stricter method
162. The === operator is used to
A. test whether two expression are equal
B. test whether two expression are not equal
C. test whether two expressions are equal using stricter methods
D. test whether two expressions are not equal using stricter method
163. The !== operator is used to
A. test whether two expression are equal
B. test whether two expression are not equal
C. test whether two expressions are equal using stricter methods
D. test whether two expressions are not equal using stricter method
164. The (5==) expression returns..
A. true B. NAN C. false D. undefined
165. The (5==“5”) expression returns
A. true B. NAN C. false D. undefined
166. The (5!=5) expression returns
A. true B. NAN C. false D. undefined
167. The (5!=“5”) expression returns
A. true B. NAN C. false D. undefined
168. The (5===5) expression returns
A. true B. NAN C. false D. undefined
169. The (5===“5”) expression returns
A. true B. NAN C. false D. undefined
170. The (5!==“5”) expression returns
A. true B. NAN C. false D. undefined
171. The meaning of the following operator “>” is
A. less than B. greater than
C. less than or equal to D. greater than or equal to
172. The meaning of the following operator “<“ is
A. less than B. greater than
C. less than or equal to D. greater than or equal to
173. The meaning of the following operator “<=” is
A. less than B. greater than
C. less than or equal to D. greater than or equal to
174. The meaning of the following operator “>=” is
A. less than B. greater than
C. less than or equal to D. greater than or equal to
175. What is the output of the following code segment is executed?
var MyObj={star; “algol”, constellation; “Oerseys”};
alert (“star” in MyObj);
A. true B. NAN C. false D. undefined
176. What would be the value of “a” when following JS code is executed?
var a = -10;
var p = ++a;
var q = a++;
var s = +p;
A. -8 B. -9 C. 9 D. 10
177. What would be the value of “p” when following JS code is executed?
var a = -10;
var p = ++a;
var q = a++;
var s = +p;
A. -8 B. -9 C. 9 D. 10
178. What would be the value of “q” when following JS code is executed?
var a = -10;
var p = ++a;
var q = a++;
var s = +p;
A. -8 B. -9 C. 9 D. 10
179. What would be the value of “s” when following JS code is executed?
var a = -10;
var p = ++a;
var q = a++;
var s = +p;
A. -8 B. -9 C. 9 D. 10
180. In JavaScript strings are written within
A. # B. @ C. “ D. *
181. What would be the value of “s” when following code is executed?
var a=-10;
var p=-a;
var q=a--;
var s=+p;
A. -8 B. -9 C. -11 D. 9
182. What would be the output when following JS code is executed?
var x=5;
alert(typeofx);
A. String B. Object C. Number D. Boolean
183. What would be the output when following JS code is executed?
var y = “john”;
alert(typeof y);
A. String B. Object C. Number D. Boolean
184. What would be the output when following JS code is executed?
alert(type of false);
A. String B. Object C. Number D. Boolean
185. What would be the output when following JS code is executed?
alert(typeof{name; „John‟,aged;34});
A. String B. Object C. Number D. Boolean
186. What is the type of x when following JS code is executed?
var y = “5”;
var x = +y;
A. String B. Object C. Number D. Boolean
187. What is the type of x when following JS code is executed?
var y = “John”;
var x = +y;
A. NaN B. Object C. Number D. Boolean
188. What is the value of a when following JS code is executed?
var b = 7;
var a=(b>5?4:8);
A. 4 B. 5 C. 7 D. 8
189. “= is a
A. unary operator B. ternary operator
C. assignment operator D. compound assignment operator
190. What are the values of a & b, when the following JS code is executed?
var a=10, b=2;
b *=a;
A. 4, 30 B. 10, 20 C. 20, 10 D. 2, 200
191. What are the values of a & b, when the following JS code is executed?
var a=10, b=2
b /=a;
A. 5, 0.4 B. 10, 0.2 C. 10, 0.1 D. 10, 0.4
192. What are the values of a & b, when the following JS code is executed?
var a=10. b=2;
b %=a;
A. 10,2 B. 2, 10 C. 5,10 D. 8, 10
193. What are the values of a & b, when the following JS code is executed?
var a=10, b=2;
b +=a;
A. 10, 12 B. 14, 10 C. 12, 12 D. 12, 10
194. What are the values of a & b, when the following JS code is executed?
var a=10, b=2;
b -=a;
A. 10, -8 B. -8, 10 C. 12, -8 D. 10,10
195. What are the values of a & b, when the following JS code is executed?
var a=1, b=10;
b <<=a;
A. 1, 20 B. 20, 1 C. 40, 1 D. 50, 1
196. What are the values of a & b, when the following JS code is executed?
var a=1, b=10;
b >>=a;
A. 1, 5 B. 5, 1 C. 7, 1 D. 6, 1
197. What are the values of a & b, when the following JS code is executed?
var a=1, b=5;
,b &=a;
A. 1, 1 B. 0, 1 C. 1, 0 D. 5, 1
198. What are the values of a & b, when the following JS code is executed?
var a=1, b=5;
b ^=a;
A. 1, 4 B. 4, 1 C. 1, 1 D. 4,4
199. What are the values of a & b, when the following JS code is executed?
var a=1, b=5;
b | = a;
A. 1, 5 B. 5, 1 C. 1,1 D. 4,4
200. The math object allows you to perform mathematical tasks on.
A. class B. strings C. numbers D. methods
201. Which method returns number between 0 and 1?
A. Math.random() B. Strings.length() C. Math.Min(4,5,6) D. Math.Max(4,5,6)
202. Which option to be executed to return the value 5?
A. Math.ceil(5.1); B. Math.floor(4.9) C. Math.round(4.7); D. Math.round(4.4);
203. How many mathematical constants are there in JS?
A. 8 B. 10 C. 12 D. 11
204. Math.E constant is one of the following constant
A. 2.718281828459045 B. 3.141592653589793
C. 1.4142135623730951 D. 0.7071067811865476
205. Math.P1 constant is one of the following constant
A. 2.718281828459045 B. 3.141592653589793
C. 1.4142135623730951 D. 0.7071067811865476
206. Math.SQRT2 constant is one of the following constant
A. 2.718281828459045 B. 3.141592653589793
C. 1.4142135623730951 D. 0.7071067811865476
207. Math.SQRT1_2 constant is one of the following constant
A. 2.718281828459045 B. 3.141592653589793
C. 1.4142135623730951 D. 0.7071067811865476
208. Math.LN2 constant is one of the following constant
A. 0.6931471805599453 B. 2.302585092994046
C. 1.4426950408889633 D. 0.4342944819032518
209. Math.LN10 constant is one of the following constant
A. 0.6931471805599453 B. 2.302585092994046
C. 1.4426950408889633 D. 0.4342944819032518
210. Math.LOG2E constant is one of the following constant
A. 0.6931471805599453 B. 2.302585092994046
C. 1.4426950408889633 D. 0.4342944819032518
211. Math.LOG10E constant is one of the following constant
A. 0.6931471805599453 B. 2.302585092994046
C. 1.4426950408889633 D. 0.4342944819032518
212. What would be the output of following JS code executed?
document.write(Math.abs(-5));
A. -5.1 B. -5 C. 5 D. 5.1
213. Which one of the following is a string?
A. “100 B. 100 C. “giti” D. #kkdk#
214. Which one of the following is a number?
A. “100” B. 100 C. “giti” D. #kkdk#
215. Which one is the number type variable?
A. var pi=3.14; B. var age= “25”; C. varcolor= “red”; D. var man= “Indian”;
216. When we declare a variable, What value it will have?
A. 0 B. 1 C. Null D. undefined
217. Which one is the correct variable declaration?
A. Vara,b,c=10; B. var basic; da; C. var a; var b; D. var age=20, sname= “kkvel”;
218. When we execute the following JavaScript code segment, What will be the output
var sname;
alert(sname);
A. NaN B. sname C. Defined D. Undefined
219. What would be the output of following JS code executed?
document.write(Math.pow(2,3));
A. 8 B. 16 C. 24 D. 32
220. What would be the output of following JS code executed?
document.write(Math.sqrt(9));
A.3 B. 4 C. 3.1 D. 3.5
221. When we execute the following JavaScript code segment, What will be the output?
var sname= “KKVEL”;
var sname;
alert(sname);
A. Null B. KKVEL C. undefined D. Nothing will be displayed
222. What is the another name of syntax error?
A. parsing error B. Exceptions C. Logical error D. Run time error
223. Local Browser used for validations on the Web Pages uses
A. HTML B. Java C. CSS D. JS
224. JavaScript code can be called by using
A. Function/Method B. Preprocessor C. RMI D. Triggering Event
225. When we execute the following JavaScript code segment, What will be the output
var y = “GITI” + “ “ + “CPT”;
alert(y);
A. GITI B. CPTGITI C. GITI CPT D. GITICPT
226. Which attribute is used to specify the character encoding used in an external script file?
A. charset B. Char C. type D. character
227. Which statement is used to test a block of codes for errors?
A. catch statement B. throw statement C. try statement D. finally statement
228. Which statement is allows to create custom error?
A. catch statement B. throw statement C. try statement D. finally statement
229. Which was the first browser to support JavaScript?
A. GoogleChrome B. IE C. Nelscape D. Mozilla Firefox
230. Executable single line of Script is called as
A. Comment B. Breakpoint in JS
C. Statement in JavaScript D. Line in JS
231. In JavaScript which method removes the last element from an array?
A. remove() B. push() C. delete() D. pep()
232. Which of the following statement is used to declare variable in JavaScript>
A. Declaration Statement B. Assignment Statement
C. Conditional Statement D. Executable Statement
<script type= “text/javascript”>
{
document.Write(“<h1> This is heading </H1>”);
}
</script>
233. Above code contain one executable statement. Guess the output of the above code
A,. This is a heading” will be printed in H1 heading
B. will not print anything (because js is case sensitive, should be in lowercase)
C. Just “This is a heading” will be printed because HTML tags are not allowed
D. will print <h1> This is a heading </h>
<script type = “text/javascript”.
//document.write(“<h1>Heading</h1>”);
document.write(“<p>Google</p>”);
document.write(“<p>Yahoo</p>”);
</script>
234. Which of the statement will be neglected by Browser?
A. <h1>Heading</h1> B. All statements
C. <p>Google</p> D. <p>Yahoo</p>
235. When we execute the following JavaScript code segment, What will be the output
var y = 15 + 7+ “10”;
alert (y);
A. 32 B. 2210 C. 1510 D. 15710
236. When executive the following code what will be the output alert(5+NaN)
A. NaN B. Null C. Infinite D. Zero
237. Variable can hold how many values at a time
A. Double B. Single C. Four digit D. Multiple
238. When we execute the following JavaScript code segment, What will be the output
var y = 15 + 7 + “10” + 2 + 3;
alert(y);
A. 2710 B. 22105 C. 221023 D. 1571023
239. Which keyword is used to declare all type of variables in JavaScript with the keyword?
A. Dim B. var C. Jvar D. obj
240. Which character cannot be used as first character in javascript but can use after first character
A. underscore B. Digit C. Dollar Sign D. Asterisk
<html>
<body>
<script>
varx=5;
var y = 6;
var z = 5 + 6;
document.write(x + “<br>”);
document.write(y + “<br>”);
document.write(z + “<br>”);
</script>
</body>
</html>
241. What is the output of the following code?
A. Error
5 5 5
B. 6 C. 6 D. 6
10 56 11
<html>
<body>
<script>
var x= “5”;
var y = 6;
var z = 5 + 6;
document.write(x + “<br>”);
document.write(y + “<br>”);
document.write(z + “<br>”);
</script>
</body>
</html>
242. What is the output of the following code?
A. Error
5 5 5
B. 6 C. 6 D. 6
10 56 11
<html>
<body>
<script>
var x= 12.45;
var y = 1;
var z = „8‟ + x + y;
document.write(z + “<br>”);
</script>
</body>
</html>
243. What is the Value of z?
A. 21.451 B. 21.450 C. 813.451 D. 812.451
244. What will be the value of Variable - “num3”?
var num1;
var num2 = 10;
var num3 = num1 + num2;
A. undefine B. NaN C. 10 D. undefine10
<html>
<body>
<script>
var x= 5;
var y = 6;
document.write(x + y) + “<br>”);
</script>
</body>
</html>
245. What will be the output of the above code?
A. 56 B. NoOutput C. 11 D. Error
<script type= “text/javascript”>
var name;
name = “Pritesh”;
</script>
<script type = “text/javascript”>
document.write(name);
</script>
246. What will be the output of the above code?
A. None of these B. Nothing will be printed C. Error D. Pritesh
247. What will be the output of the following script?
<html>
<body>
<script>
var x= 5;
document.write(x=== “5”);
</script>
</body>
</html>
A. false B. 5 C. true D. 1
248. What will be the output of the following script?
<html>
<body>
<script>
var x= 5;
document.write(x== “5”);
</script>
</body>
</html>
A. false B. 5 C. true D. Undefined
249. The statement a===b refers to
A. Both a and b are equal in value, type and reference address
B. Both a and b are equal in value
C. Both a and b are equal in value and type
D. There is no such statement
250. The snippet that has to be used to check if “a” is not equal to “null” is
A. if(a!=null) B. if (!a) C. if(a!null) D. if(a!==null)
251. Which of the following is not considered as an error in JavaScript?
A. Syntax error B. Missing of semicolons
C. Division by zero D. Missing value
252. In JavaScript, in order to execute different action according to decision, the statement followed is...
A. logical statement B. arithmetic statement C. assignment statement D.
condition/control statement
253. Which statement is used to execute a block when a specified condition is true in JavaScript?
A. if B. else C. else if D. do..while
254. Which statement is used to execute a block when a specified condition is false in JavaScript?
A. if B. else C. else if D. do..while
255. What is the output of the following code?
var x = “999 888”;
alter(Number(x));
A. 999888 B. 999 888 C. NaN D. “999 888”
256. Which statement is used to execute many alternate blocks in Javascript?
A. if B. else C. switch D. do..while
257. What would be the output, when following JS code executed?
var ctime = 17.5;
if (ctime<18){
alter(“Good day”);
}
A. goodday B. good day C. Good day D. GOOD DAY
258. What would be the output, when following JS code executed?
var ctime = 18.5;
if (time < 10) {
greeting = “Good morning”;
} else if (time < 18) {
} else {
greeting = “Good evening”;
}
A. good day B. Good day C. goodday D. Good evening
259. In JavaScript, when any case is not matched will switch case which block will be executed?
A. default B. Last case block C. first case block D. second case block
260. What will be the output when the following JavaScript code executed?
(If today is neither Saturday nor Sunday)
switch (new Date().getDay()){
case 6:
text = “Today is Saturday”;
break;
case 0:
text = “Today is Sunday”;
break;
default:
text = “Looking forward to the Weekend”;
}
document.write(text);
A. Today is Sunday B. Today is Saturday C. Today is Wednesday D. Looking forward to
the Weekend
261. What will be the output, when following JS code executed?
(Assume Today is Wednesday)
switch (new Date().getDay()) {
case 1:
case 2:
case 3:
text = “Weekend is coming”;
break;
case 4:
case 5:
text = “Weekend is coming soon”;
break:
case 6:
text = “Now in Weekend”;
}
document.write(text);
A. Weekend B. Now in Weekend C. Weekend is coming
D. Weekend is coming soon
262. In JavaScript, to run the same code over and over again which kind of statement is used?
A. Loop statements B. Logical statements C. Relational statements D. Conditional
Statement
263. In JavaScript, which loop statement executes a block of code at a specified number of times?
A. For loop statement B. While loop statement
C. For/in loop statement D. Do..while loop statement
264. In JavaScript, which loop statement executes through the properties of an object?
A. For loop statement B. While loop statement
C. For/in loop statement D. Do..while statement
265. In JavaScript, which loop statement executes through the loop while a specified condition is true?
A. For loop statement B. While loop statement
C. For/in loop statement D. switch loop statement
266. In the following JavaScript for loop syntax, the statement 1 is called as...
for(statement 1; statement 2; statement 3){
code block to be executed
}
A. first part B. condition part
C. initialization part D. increment/decrement part
267. In the following JavaScript for loop syntax, the statement 2 is called as...
for(statement 1; statement 2; statement 3){
code block to be executed
}
A. first part B. condition part
C. initialization part D. increment/decrement part
268. In the following JavaScript for loop syntax, the statement 3 is called as...
for(statement 1; statement 2; statement 3){
code block to be executed
}
A. first part B. condition part
C. initialization part D. increment/decrement part
269. In the following JavaScript for loop syntax, the statement executed first
for(statement 1; statement 2; statement 3){
code block to be executed
}
A. code block B. statement 1 C. statement 2 D. statement 3
270. What will be output, when the following JS code executed?
var train = [“vaigai”, “Tamilnadu”, “Sethu”];
var j=1;
for( len = train.length, text = “„„;i<len;){
text += train[i] + “\t”;
i++
}
document.write(text);
A. Sethu B. Vaigai C. TamilnaduSethu D. VaigaiTamilnaduSethu
271. What will be output, when the following JS code executed?
var train = [“vaigai”, “Tamilnadu”, “Sethu”];
var j=1, text=””;
var len = train.length;
for (; ;){
text += train[i] + “\t”;
i++
if(i>=len)break;
}
document.write(text);
A. Sethu B. Vaigai C. TamilnaduSethu D. VaigaiTamilnaduSethu
272. What will be output, when the following JS code executed?
var person = {fname; “Kumaravel”, lname: “Sen”, age:35};
var x, text=””;
for(x in person){
text += person[x] + “\t”;
}
document.write(text);
A. Kumaravel35 B. Kumaravel 35 Sen C. Kumaravel Sen 35 D. 35 Kumaravel Sen
273. What will be output, when the following JS code executed?
var i=1, text=””;
while(i<=3){
text +=i+ “\t”;
i++;
}
document.write(text);
A. 1 B. 1 2 C. 1 2 3 D. 1 2 3 4
274. What will be output, when the following JS code executed?
var i=4, text=” “;
do{
text +=i+ “\t”;
i++;
}while(i<4)
document.write(text);
A. 4 B. 1 2 C. 1 2 3 D. 1 2 3 4
275. What will be output, when the following JS code executed?
var i=3, text=“Numbers:”;
do{
break;
text +=i+ “\t”;
i++;
}while(i<4)
document.write(text);
A. Numbers: B. Numbers:4 C. Numbers:1 2 D. Numbers: 1 2 3
276. What will be output, when the following JS code executed?
var i=3, text=“Numbers:”;
do{
i++;
continue;
text +=i+ “\t”;
}while(i<4)
document.write(text);
A. Numbers: B. Numbers:4 C. Numbers:1 2 D. Numbers:1 2 3
277. What will be output, when the following JS code executed?
var train = [“Vaigai”, “Tamilnadu”, “Sethu”];
var i=0, text= “”;
while(train[i]){
text += train[i] + “\t”;
i++‟
}
document.write(text);
A. Sethu B. Vaigai C. TamilnaduSethu D. VaigaiTamilnaduSethu
278. A JavaScript function is executed....
A. automatically B. time interval C. when called D. none of above
279. Javascript code is placed in side
A. [ ] B. ( ) C. { } D. “ ”
280. Functions offen
A. procedures B. return value C. executions D. variables
281. Functions arguments work as
A. global variables B. local variables C. function variables D. window objects
282. All global variables belong to..
A. window object B. local variables C. HTML elements D. none
283. Variables declared outside a function is..
A. local variable B. function variable C. global variable D. global object
284. JavaScript object has
A. properties&methods B. only properties C. only methods D. none
285. Global variables are deleted when
A. function is completed B. function is called C. page is closed D. none
286. Scope is the set of
A. variables objects & functions B. variables and objects
C variables and functions D. variables only
287. Polymorphism is used in
A. moduler programming B. structured programming
C. event-driven programming D. object-oriented programming
288. Encapsulation is used in
A. moduler programming B. structured programming
C. event-driven programming D. object-oriented programming
289. JavaScript supports...
A. moduler programming B. structured programming
C. event-driven programming D. object-oriented programming
290. Which of the following programming techniques uses inheritance?
A. moduler programming B. structured programming
C. event-driven programming D. object-oriented programming
291. Which one of the following allows developers to bundle all functionality under a uniques application-
specific name?
A. Class B. Object C. Property D. Name space
292. Which is a template definition of variable and methods of an object?
A. Class B. Object C. Property D. Name space
293. An instance of class is
A. Class B. Object C. Property D. Name space
294. A subroutine or function associated with a class is
A. Class B. method C. Property D. Name space
295. An object characteristic, such as color in
A. Class B. method C. Property D. Name space
296. Which has same name as that of the class containing it?
A. Class B. method C. Property D. Constructor
297. A class can acquire characteristics from another class is
A. inheritance B. abstraction C. encapsulation D. polymorphism
298. A method of bundling the data and methods that use them together is
A. inheritance B. abstraction C. encapsulation D. polymorphism
299. Different classes define the same method or property is called
A. inheritance B. abstraction C. encapsulation D. polymorphism
300. Which are not present in a prototype based programming?
A. Class B. method C. Property D. Constructor
301. What is the fullform of WYSIWYG
A. What You See is What You Get B. Which You See is What You Get
C. What You Saw Is What You Get D. Which You See is What You Get
302. KompoZer supports
A. Copy and paste text B. Importing text from other applications
C. Imporing object from other applications D. Importing webpage from other applications
303. Inheritance is a way to create a class as a specialized version of one or more classes. Name the
specialized class?
A. Sub Class B. Main class C. Child Class D. Parent class
304. Name the special variable, which can hold more than one value at a time?
A. Array B. Control C. Element D. Statement
305. When we declare a variable x as follows :
var x ={ifiName: “GITI”, address: “CPT”};
The data type of x is
A. String B. Object C. Number D. Boolean
306. When we declare a variable x as follows :
var x = 10 + “Apple”;
alert(x);
The output will be
A. Apple B. Apple10 C. 10Apple D. 10 Apple
307. Which is used to access an array element?
A. Page number B. Index number C. Table number D. Content number
308. Array index starts with...
A. 0 B. 1 C. x D. n
309. Name the number marked „x‟ in the given Javascript code
var name = trades [0];
x
A. Page number B. Index number C. Table number D. Content number
310. What is the name of „x‟ in the given JavaScript code.
var name = trades [0];
x
A. Array B. Control C. Element D. Statement
311. Which of the following is a valid JavaScript code to sort the elements of an array trades?
A. var y = trades.sort; B. var y = sort(trades); C. var y = sort().trades; D.
var y = trades.sort();
312. What is use of the following is JavaScript code?
Var trades = [“COPA”, “ICTSM”, “DTPO”];
Trades [trdes.length] = MCH”
A. Adds MCH to trades B. Finds length of MCH
C. Finds length of trades D. Adds COPA, ICTSM and DTPO to trades
313. What is the result of the following JScode?
var n;
var trades = [“COPA”, “DTPO”, “MCH”];
for (n=0; n<trades length; n++)
{
text += trades[n];
}
alert (text);
A. COPADTPOMCH B. COPA,DTPO,MCH C. COPADTPOMCH D. COPADTPOMCH;
314. Arrays with names indexes are called
A. associative array B. One dimensional array
C. two dimensional array D. multi dimensional array
315. Associative arrays are called
A. maps or dictionaries B. one dimensional array
C. two dimensional array D. multi-dimensional array
316. In JavaScript, date object is automatically converted to a string with the method...
A. String ( ) B. toString ( ) C. to UTC String ( ) D. toDateString ( )
317. In JavaScript, the date is converted in to a display standard by the method
A. String ( ) B. to String ( ) C. toUTCString ( ) D. To Date String ( )
318. In JavaScript, date object is automatically converted in to a more readable format by the method
A. String ( ) B. to String ( ) C. toUTC String ( ) D. toDateString ( )
319. MySQL is a
A. database management system B. Programming language
C. compiler D. application software
320. A conditional expression is also called a
A. alternatie to if-else B. immediate if C. If-then-else statement D. simple if statement
321. The “var” and “function are used in
A. Statements conditional B. Declaration statements
C. Data types D. Prototypes
322. In the following switch syntax, the expression is compared with the case labels using which of the
following operators function?
switch(expression)
{
statements
}
A. = = B. equals C. equal D. = = =
323. What does the following code result?
functionprintArray(a)
{
var a = [22, 33, 44];
var len = a.length, i = 0;
if (len = = 0)
console.log(“Empty Array”);
else
{
do
{
console.log(a[i]);
} while (++i<len);
}
}
A. Prints the numbers in the array in order B. Prints the numbers in the array in the reverse order
C. Prints 0 to the length of the array D. Prints “Empty Array”
324. What will be the role of the continue keyword in the following code snippet?
while (a!=0)
{
if (a = = 1)
continue;
else
a++;
}
A. The continue keyword restarts the loop B. The continue keyword skips the next iteration
C. The continue keyword skips the rest of the statements in that iteration
D. The else part only will execute
325. What is the possible output for the following code snippet?
var a = [1,2,3,4,5];
a.slice(0,3);
A. Returns[1,2,3] B. Returns[4,5] C. Returns[1,2,3,4] D. Returns[1,2,3,4,5]
326. Which method or operator used to identify the object is an array
A. isarrayType() B. == C./ === D. isarray()
327. When does the function name become optional in JavaScript?
A. When the function is defined as a looping statement
B. When the function is defined as expressions
C. When the function is predefined
D. When the function is called
328. What is the purpose of a return statement in a function?
A. Returns the value and continues executing rest of the statements, if any
B. Returns the value and stops the program
C. Returns the value and stops executing the function
D. Stops executing the function and returns the value
329. What will happen if a return statement does not have an associated expression?
A. it returns the value 0 B. It will throw an exception
C. it returns the undefined value D. It will return string null
330. A function with no return value is called
A. Precedures B. Method C. Static function D. Dynamic function
331. What does the following code result?
functionhypotenuse(a,b)
{
function square(x)
{
return x*x;
}
return math.sqrt(square(a) + square(b));
}
A. Sum of square of a and b B. Square of sum of a and b
C. Sum of a and b square D. Multiplication of x
332. Which built-in method returns the string representation of the number‟s value?
A. toValue() B. toNumber() C. Number() D. toStr()
333. Which of the following function of String object returns the character at the specified index?
A. charAt() B. charCodeAt() C. concat() D. indexOf()
334. Which of the following function of String object causes a string to be displayed in a small font, as if it
were in a <small> tag?
A. link() B. small() C. sup() D. sub()
335. When we declare a variable x as follows:
var x = “10” + “Apple”;
alert(x);
The output will be
A. Apple B. Apple10 C. 10Apple D. 10 Apple
336. When we execute the following JavaScript code segment, What will be the output?
var z;
z=10;
z= “CPT”;
alert(z);
A. 10 B. CPT C. CPT10 D. 10CPT
337. What is the HTML tag under which one can write the JavaScript code?
A. <javascript> B. <scripted> C. <script> D. <js>
338. What is the correct syntax for referring to an external script called “geek.js”?
A. <script src= “geek.js”> B. <script href= “geek.js”>
C. <script ref= “geek.js”> D. <script name = “geek.js”>
339. Which of the folloiwng is not a reserved word in JavaScript?
A. interface B. throws C. program D. short
340. What will be the output for the below program?
<scripttype=”text/javascript”language=”javascript”>
var a = “GeeksforGeeks”;
var result = a.substring(4,5);
document.write(result);
</script>
A. sf B. ks C. s D. k
341. What is the syntax for creating a function in JavaScript named a Geekfunc?
A. function = Geekfunc() B. functionGeekfunc()
C. function:=Geekfunc()D. function : Geekfunc()
342. How to write an „if‟ statement for executing some code if “I” is NOT equal to 8?
A. if(i<>5) B. if i<>5 C. if(i!=8) D. if i!=5
343. How to initialize an array in JavaScript?
A. var Geeks= “Geek1”, “Geek2”, “Geek3”
B. var Geeks= (1:Geek1, 2:Geek2, 3:Geek3)
C. var Geeks= (1=Geek1, 2=Geek2, 3=Geek3)
D. var Geeks= [“Geek1”, “Geek2”, “Geek3”]
344. What will be the output of the following code?
<script>
document.write(typeof(24.49));
</script>
A. float B. number C. Integer D. double
345. What will be the command to print the number of characters in the string “GeeksforGeeks”?
A. document.write(“GeeksforGeeks”.len);
B. document.write(sizeof(“GeeksforGeeks”));
C.document.write(“GeeksforGeeks”.length);
D. document.write(lenof(“GeeksforGeeks”));
346. What is the method in JavaScript used to remove the whitespace at the beginning and end of any
string?
A. strip() B. trim() C. stripped() D. trimmed()
347. Which function of an Array object calls a function for each element in the array?
A. forEach() B. every() C. forEvery() D. each()
348. Predict the output on the console for the following JavaScriptcode.
<script>
function geek() {
if(true) {
var a = 5;
}
document.write(a);
}
geek();
</script>
A. Compilation Error B. Nothing will be printed as output
C. 5 D. Runtime error
349. Predict the output of the following JavaScriptCode.
<script type=”text/javascript”>
<!-
document.write(“Hello”);
//-->
</script>
A. Nothing B. Compilation Error C. Hello D. <!-document.write(“Hello”);//-
>
350. What are capabilities of unctions in JavaScript?
A. Return a value B. Accept parameters and Return a value
C. Accept parameters D. Execute the statements only
351. Which tag is used to enclose any number of JavaScript statements?
A. <SCRIPT> B. <BODY> C. <HEAD> D. <TITLE>
352. Which attribute can hold the JavaScript version?
A. language B. script C. version D. None of the above
353. How do you call a function named “myFunction”?
A. call function myFunction() B. myFunction()
C. callmyFunction() D. gomyFunction()
354. Which is the correct way to write a JavaScript array?
A. var txt = newArray(1:”red”,2:”green”,3:”blue”)
B. var txt = newArray:1=(“red”)2=(“green”)3=(“blue”)
C. var txt = newArray(“red”,”green”,”blue”)
D. var txt = newArray=”red”,”green”,”blue”
355. When we execute the following JavaScript code segment, What will be the output?
var z = “It‟s My Name”;
alert(z);
A. s My Name B. If My Name C. Its My Name D. It’s My Name
356. Which one is not a JavaScript operator?
A. new B. delete C. this D. typeof
357. How does a WHILE loop start?
A. whle (i <=10;i++) B. while (i <= 10) C. while i = 1 to 10 D. while(10<=i)
358. Which one is correct for statement?
A. for (i = 0; i <= 5; i++) B. for (i <= 5; i++)
C. for i = 1 to 5 D. for i = 0; i <= 5)
359. What 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. It refers current variable
360. How do you round the number 7.25 to the nearest integer?
A. md(7.25) B. Math.md(7.25) C. Math.round(7.25) D. round(7.25)
361. How do you find the number with the highest value of x and y?
A. Math.max(x,y) B. top(x,y) C. ceil(x,y) D. Math.ceil(x,y)
362. Which method of an Array object adds or removes elements from an array?
A. Reverse B. Shift C. Slice D. Splice
363. Which of the following asserts that the variables „A‟, „B‟ and „C‟ have unequal values?
A. A !== B || B ! == C B. A !== B & B !== C
C. A !== B && B !== C && A !== C D. A !== B
364. Which symbol is not used in logical operations?
A. || B. % C. && D. !
365. How do you check what the type of a value in variable x is?
A. gettype(x); B. x.type; C. Object.type(x); D. typeof(x);
366. Which of the following is a valid function definition?
A. functionmyFunc(arg1,arg2){} B. func myFunc = (arg 1 as string, arg2 as int) {} C.
functionmyFunc(arg`, arg2): D. functionmyFunc(arg`,arg2);{}
367. What is the value of x?
var a = “A”; var x = a.concat(“B”);
A. “B” B. “A” C. “AB” D. [“A”, “B”];
368. What keyword is used to define the alternative path to take in a conditional statement?
A. or B. else C. alternative D. Next
369. What is the full form of BOM?
A. Browser Object Model B. Browser Object Method
C. Browser Oriented Model D. Browser Oriented Method
370. Which is a platform and language-neutral interface?
A. W3C Document Object Model (DOM)
B. W3C Document Oriented Model (DOM)
C. WWW Documentation Object Model (DOM)
D. W3C Document Object Modelling (DOM)
371. Which of the JavaScript window method is used to move the current window?
A. Move() B. Move To() C. Window.Move() D. Window.moveTo()

372. Which of the JavaScript window method is used to resize the current window?
A. Resize ( ) B. Resize To ( ) C. Window.Resize ( ) D. Window.resizeTo( )
373. Which of the following Javascript property returns the with of the visitor‟s screen in pixels?
A. Width B. Scrren width C. screen.width D. Screen.avail width
374. Which of the following javascript property returns the height of the visitors screen in pixels?
A. Height B. Screen Height C. screen.height D. Screen.avail Height
375. Which of the following Javascript property returns the URL of the current page?
A. href B. <href> C. location.href D. Location href
376. In Javascript, the property location hostname returns
A. URL B. web protocol C. domain name D. path and file name
377. Which of the following Javascript method loads a new document?
A. Load ( ) B. Assign ( ) C. Location.Load ( ) D. Location.assign ( )
378. Which URL in the history list is loaded by the history back ( ) method of JavaScript?
A. NextURL B. Previous URL C. The very first URL D. The very last URL
379. Which URL in the history lint is loaded by the history, forward ( ) method of Javascript?
A. NextURL B. Previous URL C. The very first URL D. The very last URL
380. When we execute the following JavaScript code segment, What will be the output
var z = „He is my “Honourable” Teacher‟;
alert(z);
A. Honourable B. He is my Teacher
C. Honourable Teacher D. He is my “Honourable” Teacher
381. Which notation is used to write extra-large or extra small numbers?
A. Octal notation B. Binary notation
C. scientific notation D. Hexadecimal notation
382. JavaScript can access and modify all the elements of an HTML document with the help of
A. HTML B. HTML dom C. HTML tags D. HTML tags with a aributes
383. The browser creates a DOM of the page when a web page is
A. saved B. loaded C. opened D. down loaded
384. Which of the following is standard is the DOM?
A. W1C B. W2C C. W3C D. W4C
385. Which one of the following DOM is a standard model for all document types?
A. DOM B. XML DOM C. Code DOM D. HTML DOM
386. A property is
A. a standard model B. a defined element
C. an action you can do D. a value that you can get or set
387. An method is
A. a standard model B. a defined element
C. an action you can do D. a value that you can get or set
388. Which one of the following is a property in the given Javascript code?
document.getElementByld(“demo”).innerHTML = “Hellow world”)
A. demo B. document C. innerHTML D. getElement Byld
389. Which one of the following is a method in the given JavaScript code?
document.getElementByld(“demo”).inner HTML = “Hello words”)
A. demo B. document C. innerHTML D. getElementByld
390. The method document.remove child ( ) is used to
A. create HTML element B. add an HTML element
C. delete an HTML element D. replace an HTML element
391. The method document append child ( ) is used to
A. create HTML element B. add an HTML element
C. delete an HTML element D. replace an HTML element
392. Who is the owner of all the other objects in your web page?
A. Method B. Preperty C. Attribute D. Document object
393. The easiest way to find HTML elements in the DOM is by using the elements
A. id B. tag name C. class name D. HTML object
394. Which one of the following Javascript stements sets value to the HTML elements?
A. x.set attribute (“type”, “check box”);
B. var x = document.create Element(“INPUT”);
C. document.getByld(“txt 1”).innerHTML = x;
D. var x = document.getElementByld(“My Form”);
395. DOM is used to
A. access objects in the web page
B. create class automatically in the web page
C. create objects in the we page
D. change address of objects in the web page
396. Document.lastModified method returns...
A. all image elements B. date and time the document was updated
C. URI of document D. all<form>elements
397. Document.anchors method returns...
A. all <att> with a value in the name attribute
B. all<anchor> with a value in the name attribute
C. all<a> with a value in the name attribute D. all<all> with a value in the name attribute
398. In the following x represents..
document.getElementByld(„P1‟).innerHTML=”Govt.ITI CPT”;
x
A. object B. class c. Method D. Property
399. In the following x represents
document.getElementByld(„P1‟).innerHTML= “Govt.ITI CPT”;
x
A. Object B. class C. Method D. Property
400. Which one of the following JavaScript method removes focus from a submit button?
A. Blur() B., Focus() C. Select() D. Onclick()
401. What would be the output of the following JavaScript code segment?
var dist` = 12e3;
var dist2 = 12e-3;
alert(dist1 + “ “ + dist2);
A. 12e3 12e-3 B. 12000 0.012 C. 120e2 1.2e-2 D. 12000.0 0.012
402. Which one of the following javascript statement is used to access an input text object?
A. x.SetAttribute(“type”, “Input”);
B. document.get Element Byld (“My Text”);
C. Var x = document.createElement(“Input”);
D. Var x = document.get ElementByld (“My Text”);
403. What would be the output of the following JavaScript code segment?
var a = 12;
var b = 15;
alert(a == b);
A. false B. true C. NaN D. Undefined
404. Which one of the following Javascript statement creates a label object?
A. x.SetAttribute(“type”, “Label”);
B. document.get Element Byld (“My Label”);
C. Var x = document.createElement(“LABEL”);
D. Var x = document.get ElementBy ld (“My Label”);
405. In JavaScript, which of the following is used to store user information in web pages in client machine
as text files?
A. Arrays B. Applets C. Cookles D. Function
406. Which of the following Javascript property is used to create, read and delete cookies?
A. cookie () B. document.cookie
C. document.cookie.read D. document.cookie.create
407. Which of the following is a valid JavaScript statement to create a cookie?
A. cookie = user name = “copa iti” ;
B. cookie = user name = “COPA iti” ;
C. document.cookie = “username = copa iti” ;
D. document.cookie = “ username = COPA iti” ;
408. In the following x represents
document.getElementByld(„P1‟).innerHTML=”Govt.ITI CPT”;
x
A. Object B. Class C. Method D. property
409. Which of the following parameter in JavaScript is used to delete a cookie?
A. Erase B. Deletes C. expires D. remove
410. Which HTML tag is used to add image object?
A. <img> B. <image> C. <addimg> D. <add image>
411. Which is used to access an <img> element in JavaScript?
A. get Id ( ) B. Element ( ) C. get Element( ) D. getElementByld( )
412. Which of the following JavaScript image object property returns the original width of an image?
A. Width B. Height C. naturalwidth D. Naturalheight
413. Which of the following Javascript image object property returns the original height of an image?
A. Width B. Height C. Naturalwidth D. naturalheight
414. Which of the following Javascript method is used to create an image object?
A. document.Create ( ) B. document.Create (“img”);
C. document.CreateElement(Img); D. document.CreateElement(“Img”);
415. In XAMPP, „x‟ represents...
A. Perl B. My SQL C. Crossplatform D. ApacheHTPP server
416. In XAMPP, „A‟ represents...
A. Admin B. Applet C. Phpmy Admin D. ApacheHTPP server
417. In XAMPP, „M‟ represents
A. My SQL B. Ms word C. My Admin D. Phpmy Admin
418. Apache is
A. client application B. web server application
C. mail server application D. client server application
419. Which of the following is a database management system?
A. Perl B. PHP C. Apache D. MySQL
420. What is PHP?
A. Word processing software B. Client side scripting language
C. Server-side scripting language D. database management system
421. Which of the folloiwng is a high level programming language?
A. Perl B. PHP C. Apache D. My SQL
422. addEventListener() method attaches...
A. attaches an event handler to the specified element
B. attaches a property to the specified element
C. attaches a class to the specified element
D. attaches an object to the specified element
423. The official website for OpenCms is
A. http://www.opencms.org/en/ B. http://www.opencontentms.org/en/
C. http://www.opencmsystem.org/en/ D. http://www.opencontentmanagementsystem.org/en/
424. What is the full form of CMS?
A. Content Management System B. Content Managing System
C. Component Management System D. Content Management Software
425. The self executable file is...
A. ZIP B. EXE C. RAR D. DOC
426. Which of the following is a compressed file format?
A. ZIP B. EXE C. DOC D. HTML
427. Which is a standard network protocal used to transfer computer files from one host to another host
over internet?
A. IP B. FTP C. HTTP D. SMTP
428. A full-featured FTP client can be run with in firefox in the form of an extension called
A. FTP B. FoxFTP C. FireFTP D. FirefoxFTP
429. Which one of the following open source software is used to upload or download from client to server
and vice versa?
A. PHP B. Perl C. HTTP D. FILEZILLA
430. The expansion of SRS is
A System Resource Settings B. System Requirement Settings
C. System Resource Specification D. Software Requirement Specification
431. Which of the following is important before development of any system or project?
A. SRS B. Date C. Form D. Repot
432. The expansion of SDLC is
A. System Design Life Chart B. System Design Life Cycle
C. System Development Life Chart D. Systems Development Life Cycle
433. A sequence of stages in which the output of each stage becomes the input for the next. Name the
model
A. Water fall B. Synchronize C. Build and fix D. Rapid prototyping
434. At which stage of SDLC, code is written?
A. Testing B. Development C. System design D. Requirement definition
435. The first phase of SDLC is
A testing B. Development C. Planning D. requirement definition
436. The standard interfaces provided by a browser for interaction with program script is called
A. Browser Object Model B. Browser Opening Model
C. Brown Object Model D. Browser Object Mission
437. OpenCms is a
A. open source software B. testware
C. malware D. firmware
438. All HTML elements are defined as
A. Objects B. property C. methods D. events
439. document.form returns...
A. URL B. elements C. browser D. all form elements
440. What is the four primary component of XAMPP?
A. Cross-Platform, Apache, MySQL, PHP, Perl
B. Oracle, MySql, Pearl, PHP
C. Filezilla, Apache, PHP, JavaScript
D. AutoCad, PHP, MySql, Pearl
441. Which one is support provided for various components of a HTML document (like head, title, body,
etc) in a browser is called
A. Document Object Model B. Domain Object Model
C. Document Office Model D. Document Object Management
442. Methods of DOM (Document Object Model) are called on object\
A. document B. window C. button C. text
443. innerHTML property is used to
A. delete content of object B. add content to object
C. delete the object D. change the content of object
444. Cookie may have „expires‟ property which contains
A. name of owner B. date and time of expiry
C. name of browser D. name of the web server
445. document.body returns
A. <body> element B. <html> element
C. <form> elements D. DOM configuration
446. document.URL returns
A. URL B. elements C. browser D. configuration URL
447. The full form of TOC is
A. time of content B. table of contents
C. text of content D. termination of content
448. Which data type is hold in Array index?
A. number B. string C. either number or string
D. neither number nor string
449. What would be the value stored in name[3]?
var name=newArray(“Krish”,”Ram”,”Shiva”,27)
A. Krish B. Ram C. Shiva D. 27
450. Any variable declared inside a function has validity within the
A. block only B. function only C. global scope D. constant

You might also like