1. JavaScript is ...
2. Math.PI returns the mathematical constant π. What standard JavaScript method would return '3.14'?
3. What is the result? 0 == '' ''
4. How do you assign object properties?
5. What's the output? 0 == '' '';
6. Math.random() returns..
7. var x = 'foo'; x = !!x; What is the value of x?
8. How do you create an object in JavaScript?
9. When writing an object literal, how to separate the properties from each other?
10. What is the value of x? var a = false; var x = a ? “A” : “B”;
11. Which is not a logical operator?
12. How do you find the number with the highest value of x and y?
13. Which asserts that the variables `A`, `B`, and `C` have unequal values?
14. Difference between a while loop and a do...while loop?
15. How to return the first value of this array? var myArr = [1, 2, 3, 4, 5]; var myVal = ...
16. Which is NOT a way to create a loop in javascript?
17. Correct JavaScript syntax to insert a comment that can span multiple lines?
18. Where do you use the 'break' statement?
19. In an array object, what is the key of the first value?
20. what is the difference between x++ and ++x?
21. The var statement is used to:
22. Which primitive value exist in JavaScript?
23. Which statement loops through an array?
24. You use the Math.pow() method to:
25. Value of ('dog'.length)?
26. How do you round the number 7.25, to the nearest whole number?
27. Are variable identifiers case-sensitive?
28. String literals are written using:
29. Which is a valid function definition?
30. JavaScript supports dynamic typing, you can assign different types of values to the same variable.
31. How do you check what the type of a value in variable x is?
32. What does the 'break' statement do?
33. What does myFunc() return? var foo = 'foo' var bar = 'bar' function myFunc() { return foo + bar; }
34. Correct way to write a JavaScript array?
35. Which is a JavaScript comment?
36. How do you define a function called 'fName'?
37. Which symbol is not used in logical operations?
38. Which declares a variable with a value of string type?
39. Which is not a reserved word?
40. Correct way to create an instance of Person?
41. Which of these will throw a SyntaxError?
42. What is the value of the following expression: 8 % 3
43. What operator is used for string concatenation?
44. Which of these descriptors applies to JavaScript?
45. Properties of objects may be accessed using...
46. Properties of a RegExp object include:
47. What does isNaN() do?
48. The `else` statement is ___
49. USERNAME and userName
50. What is JavaScript used for?
51. What is the value of a : var a = 3; var b = 2; var c = a; var a=b=c=1;
52. What is the difference between == and === ?
53. Which operator compares two variables by value AND type?
54. What is the value of the array myArr after execution of the following code: var myArr = [1,2,3,4,5]; myArr.shift();
55. A for loop is written as such: 'for (first property; second property; third property) {...}' What does the third property represent?
56. In JavaScript, to call a function directly, you use:
57. Which event fires whenever a control loses focus?
58. (function( ) { var x = foo( ); function foo( ){ return 'foobar' }; return x; })( ); What does this function return?
59. var a = {1: 'one',2:'two',3:'three'}; var b = Object.keys(a); What's the value of b?
60. What is the value of x? var x = '1'+2+3;
61. Which orders can be performed with the Array prototype 'sort()' callback?
62. null === undefined
63. When an array index goes out of bounds, what is returned?
64. Which invokes a user-defined object constructor function?
65. Which is an Error object constructor?
66. The 'exploit' property:
67. Which is the equivalent of the following. if (a) { x = b; } else { x = c; }
68. Which operator can assign a value to a variable?
69. How do you declare a function?
70. Correct syntax to write array literals in JavaScript?
71. JavaScript is an implementation of the ______ language standard.
72. The function call Math.ceil(3.5) returns:
73. How do you assign an anonymous function to a variable?
74. What is the RegExp object constructor used for?
75. Which is not a JavaScript statement?
76. split() is a method of which constructors' prototype?
77. Which is a way to add a new value to the end of an array?
78. Name of the String prototype that appends the given string to the base string and returns the new string?
79. The _______ operator returns a string that identifies the type of its operand.
80. What is the value of x? var x = 2 + '2';
81. Which variable type does not exist in JavaScript?
82. What does Math.sqrt(-1) return?
83. How can you concatenate multiple strings?
84. Which is a correct method to create a new array?
85. To what type are values converted internally when evaluating a conditional statement?
86. What does ''2'' + 3 + 4 evaluate to?
87. Which has the correct syntax of a ternary operation?
88. Consider this code: var x = ['Hello']; What value will 'x[1]' return?
89. Result of the following expression: var a = 'test'; console.log(!!a);
90. The loop isn't working. What's the problem? var foos = ['a', 'b', 'c' , 'd', 'e']; var bars = ['x', 'y', 'z']; for (var i = 0; i < foos.length; i++) { var foo = foos[i]; for (var i = 0; i < bars.length; i++) { var bar = bars[i]; /* some code using `bar` */ } }
var foos = ['a', 'b', 'c' , 'd', 'e']; var bars = ['x', 'y', 'z']; for (var i = 0; i < foos.length; i++) { var foo = foos[i]; for (var i = 0; i < bars.length; i++) { var bar = bars[i]; /* some code using `bar` */ } }
91. If a function doesn't explicitly use the 'return' operator, what will the return value be when the function is invoked?
92. How do you write a conditional statement that will only execute the contained code if variable x has a value 5 of type number?
93. Value of x? function foo(y) { var z = 10; z = 7; }; var x = foo('bar');
94. In the loop, 'for (first clause; second clause; third clause) { statements; }' What does the second clause represent?
95. What are curly braces ('{' and '}') used for?
96. Syntax for an object literal (with no properties)?
97. Functions in javascript are always ..
98. Which is not a method in the 'JSON' object according to the ECMAScript specification?
99. What is the value of 'x' ? var a = true, b = false, x = !(a===b) ? !a : b;
100. Given a variable named stringVar with a string value, what does the following do? stringVar.toUpperCase();
101. What will invoking `foo` return? function foo() { var x = 10; x = 7; };
102. How can you get the number of characters in a string ?
103. What is the value of x? var x = ['foo', 'bar']; x.length = 1;
104. Which is an example of (only) an object literal in Javascript?
105. The 'this' keyword refers to ...
106. The length property of an Array object is always:
107. Is there a value type for individual string characters?
108. Value of `x` after the following? var x = 'hello'; (function() { x = 'goodbye'; }());
109. What is the value of x after the following statement? var x = 1 == '1'
110. Result of the following expression? ({'foo': true}).foo;
111. Primitive types are passed by :
112. Every object is linked to a _________ object from which it can inherit properties.
113. What will be logged to console? function foo(a){ console.log(a); }( 1+'1' );
114. Which is not a primitive data type in JavaScript?
115. Result of the following statement: typeof 'x';
116. What is the type of `null`, according to the `typeof` operator?
117. What is the value of x? var x = 1/0;
118. What is the value of x? var x = 10/0;
119. What does this line do? variable++;
120. '&' Operator is _____
121. var y = 3, x = y++; What is the value of x?
122. What is this? (function() { /* code */ })()
123. What is the value of x? var x = typeof null;
124. What is the value of x? var x = typeof new String('abc');
125. Difference between the 'var' keyword and the new 'let' keyword which appears in ECMAScript 6 ?
126. var data = [1, 2, 3, 4, 5, 6]; data.shift(); What does data look like?
127. var a = new Boolean(false); What is (typeof a)?
128. Which String prototype method is capable of removing a character from a string?
129. Different ways to affect the 'this' reference in a function?
130. Which type does NOT exist in javascript?
131. What's the output? 1 + 5 + ' bottles of milk';
132. Which fact is true about the keyword 'default'?
133. What does null, undefined, 'string', 20, true and false have in common?
134. var x = Math.ceil(10.126); What is the value of x?
135. Does NaN equal itself?
136. Value of x after the following code is executed? var x = 0; x = x++;
137. End value of myAddedVar with the following code: var myVar = '5' var myAddedVar = myVar + 10;
138. You use the Math.tan( ) method to:
139. What is the result? '''' ? ''a'' : ''b''
140. What will the expression a === b return after the following? var a = {'foo': 'bar' }; var b = { 'foo': 'bar' };
141. Which is not a built-in object constructor?
142. var obj1 = {}; var obj2 = {}; What is the value of (obj1 === obj2)
143. What's the output? (function(a){ return function(b){ return function(c){ console.log(a + b, c); } } })(1)(2)(3)
144. Which is not a bitwise operator
145. Which will invoke a function?
146. Which Object method takes a `propertyName` parameter and returns `true` if the object contains an uninherited property with that key?
147. Difference between using call() and apply() to invoke a function with multiple arguments?
148. What's the output? if ('foo') { console.log('foo' === false); console.log('foo' === true); }
149. Right way to combine two arrays into a new array? var a = ['a', 'b', 'c']; var b = ['d', 'e', 'f'];
150. function b(x, y, a) { arguments[2] = 10; alert(a); } b(1, 2, 3); What is alerted?
151. A javascript variable prefixed with a $ is:
152. console.log(3%2&1); The console displays:
153. Consider the following variable assignments: var a = 1; var b = 2; var r = a | b; The value of r is:
154. Read the following function : function custom_indexOf( array, value ){ for(var i = 0; i < array.length; i++){ if(array[i] == value) return i; } } The property 'length' of array is calculated at every loop beginning (true or false)
155. What's the output? if (new Boolean(false)) console.log('True'); else console.log('False');
156. Infinity * null will return :
157. What is the result of: function foo() { output( 'biz' + bar() ); } bar(); var bar = function() { return 'baz'; }
158. Which operator has highest precedence?
159. true + true will return :
160. Which assigned value of x will cause (x == x) to return false?
161. [] === [] evaluates to
162. When reserved words are used as keys in object literals they must be ______?
163. What does the following return? Number(null);
164. Given the following code: var myVar = '5' var myAddedVar = myVar + 10; What is the value of (myAddedVar.constructor === Number)?
165. Difference between the two declaration methods below? var functionOne = function() { /* some code */ } function functionTwo() { /* some code */ }
166. What is the output? var one; var two = null; console.log(one == two, one === two);
167. Which is NOT a valid way to write a loop that will iterate over the values in the array in variable 'myArray'?
168. An (inner) function enjoys access to the parameters and variables of all the functions it is nested in. This is called:
169. (function() { 'use strict'; foo = 'bar'; })();
170. The expression (typeof NaN === 'number') evaluates to:
171. What is the value of x? var x = typeof NaN;
172. How does JavaScript interpret numeric constants outside of strict mode?
173. Which is not a reserved word in the language?
174. var x = {}; var foo = function () { this.hello = 'Hi'; return this; }; x.bar = foo; What is the value of the following code: x.bar().bar().hello;
175. Value of x? var y = '100'; var x = + y + 10;
176. Which String prototype method takes a regular expression?
177. What's the output? console.log(1 + '1' - 1);
178. Evaluate: '10' - (17).toString()
179. True or false ? typeof(null) == typeof(undefined)
180. What will: typeof typeof(null) return?
181. Evaluate: undefined + 2
182. Value of x.length after running this code? x = ['foo']; x.quux = 'Hello'; x[1] = 'bar';
183. console.log(1 + +'2' + '2')
184. Value of x? var z = [typeof z, typeof y][0]; var x = typeof typeof z;
185. What value is passed to function 'foo' as first argument? foo( +'5' );
186. Which expressions evaluates to false?
187. What does the >>> operator do?
188. What's the output? var printName = function() { console.log('Matt'); printName = function() { console.log('James'); }; }; var copy = printName; printName(); copy();
189. Assuming alert displays a string of its argument: var a = 10; function example(){ alert(a); var a = 5; } example(); What will be shown if the preceding code is executed?
190. How can you remove an element from an array and replace it with a new one ?
191. Which two values are logged by the following code? var x = 5; (function () { console.log(x); var x = 10; console.log(x); }());
192. What's the output? function sayHi(person) { 'use strict'; message = 'Hi, ' + person; console.log(message); } person = 'Jim'; sayHi(person);
193. Object.keys(x)
194. What's visible in the console after running code: var a = 'Bolt' function f() { if (!a) { var a = 'Nut' } console.log(a); } f(); console.log(a);
195. var a = isNaN(null); is a true or false?
196. Evaluate: new Boolean(new Boolean(false)).valueOf()
197. Consider: var x = ['a', 'b', 'c']; Which line of code will remove the first element of the array, resulting in x being equal to ['b', 'c']?
198. console.log( typeof [1,2] ) will print out:
199. What will the following code, when evaluated, do? var void = function () {};
200. function Question() { this.answered = false; } Question.prototype.rightAnswer = 5; console.log( new Question().rightAnswer, Question.rightAnswer ); What gets printed to the console?
201. 'bar'.split().length returns:
202. Math.min() < Math.max(); will return
203. After the following code: var a = function(){ this.b = 1; this.deleteMe = function(){ delete this; } }; var c = new a(); c.deleteMe(); What is the value of (String(c))?
204. var q = null; q++; What is q?
205. var x = { foo: 'A' }; x.constructor.prototype.foo = 'B'; var y = {}; console.log(x.foo); console.log(y.foo); Which two values will be logged?
206. What will be the result of this expression: void 0
207. Value of x after the following code is run? var obj = { 0: 'who', 1: 'what', 2: 'idontknow'}; var x = 1 in obj;
208. Value of a after executing the following: var a = [1, 2, 3]; a.splice(1, 2, 3);
209. What's the output? function foo(bar) { return bar ? bar == foo : foo(foo); } var result = foo();
210. What's the output? var Apple = function() { var color = 'green'; var apple = { picked:false, pick: function() { this.picked = true; console.log (color); color = 'yellow'; }, change: function() { this.color = Math.random() > 0.5 ? 'yellow':'red'; } }; return apple; } var a = Apple(); a.pick(); console.log (a.color);
211. function foo() { this = 'foo'; } var a = foo(); What will the preceding code produce?
212. Values of x and y after the invocation of `foo` in following? var x = 'I am global x'; var y = 'I am global y'; function foo() { var y = x = 'Hello from foo'; } foo();
213. What will this code produce: +new Date()
214. What is the value of x? var a = 'abc'; var x = a instanceof String;
215. Math.log(x) returns:
216. Which will create a copy of an array such that changes to the old array will not be reflected in the new array?
217. What does Math.random() do?
218. String values have a 'length' property. Why is this property not included in a for-in loop over a string object? var prop, str; str = 'example'; /* str.length === 7 */ for ( prop in str) {}
219. What is the value of mike after this code is run? function Person(name, age) { this.name = name; this.age = parseInt(age, 10); } var mike = Person('Mike', '25');
220. Correct syntax for creating a Date object for January 10, 1998?
221. Consider the following variable assignments: var a = 1; var b = 2; var c = 3; var r = a & b & c; The value of r is:
222. What does the following return? Math.max();
223. What's the output? var test = function (firstName, surname) { this.Name.FirstName = firstName; this.Name.Surname = surname; } test.prototype = { Name: { FirstName: undefined, Surname: undefined } } var b = new test('john', 'doe'); var c = new test('bob', 'templeton'); console.log(b.Name.FirstName + ' ' + b.Name.Surname + ', ' + c.Name.FirstName + ' ' + c.Name.Surname);
224. What is the value of c? var a = function(){ this.b = 1; } var b = function(){ this.b = new a().b; return 5; } var c = b() + new b();
225. What is the value of 'x' after the following code runs? var x; x++;
226. What will be printed to console? function Foo(){ var foo = 1; bar = 'hello' } var f = new Foo; console.log(f.foo,bar);
227. Which Array prototype method actually modifies the array it's been called on?
228. What will be printed in console? var i = function(){ return 10; }(); console.log(i());
229. Consider the following variable assignments: var a = 144; var p = 3; The operation a >> p yields the same result as:
230. Consider the following variable assignment: var s = Math.random(9,100); the variable s is:
231. Consider the following variable assignments: var a = 1; var b = 2; For the values set above the operation (a & b) returns the same result as:
232. What is the value of x? var x = ~1001;
233. Be it variable 's', holding a number. The operation 1 + (~s) yields the same result as:
234. Last value of the variable named 'i' ? var i = 5; for(i = 0; i < 11; i += 2){ i += 3; }
235. var x = ~1001 + '123' << 2; What is the value of x?
236. Be it a = 101 and p = 3 The operation a << p yields the same result as:
237. What's the output? !function(){ console.log('!') }();
238. Evaluate: ![]+[]
239. Be it a = 500 a >> 5 is the same as
240. Consider the function f: var f = function(a,b,c) { console.log(a,b,c); } Out of the options below, what is the right way of calling the function in order for the console to output nothing else than "1 2 3"?
241. When using JavaScript to access the DOM, what will document.querySelector('*') return?
242. What does the nodeValue property return for an HTML element node?
243. What is the value of myArray at the end of the following lines : var myArray = ['a', 'b']; myArray.concat(['b', 'c'])
244. What will be the Function length in this case: function zeroFunc(name, value)
245. JavaScript is a[n] ... -scoped programming language.
246. Unlike C and C++, Javascript executes all statements .....
247. What will the log display after executing the following? var book = { page1: 'Once upon a time...', page2: 'And thus they traveled north...', page3: 'The rock golem hoisted...', printPages: function() { return book.page1 + book.page2 + book.page3; } } for (page in book) { console.log(page); }
248. Consider the following code: var bar = (function(){ function Bar(){}; return new Bar(); })(); How will you make another instance of Bar?
249. If Math.max(3, []); = 3, What is Math.max(3, {}); ?
250. What is Math.max(5, [1, 4]);?
251. True or false? 'hello'.charAt(-1) === 'hello'[-1]
252. Which is not a datatype in javascript according to ECMAScript 6?
253. functionmyFunction() { varnum = 2; return innerFunction(num); function innerFunction(x) { return x*3; } }
254. How many datatypes are there in javascript according to ECMAScript 6 specifications?
255. What's the output? functionmyFunction() { varnum = 2; return innerFunction(num); varinnerFunction = function(x) { return x*3; } }
256. The difference between == and ===
257. var a = ['a','b','c']; console.log(a[2]);
258. Which one is a construct function ?
259. When automatic conversion of primitive values to objects (autoboxing) works in Javascript?
260. What will be the output when the following code executed console.log(flase === '0')
261. You want a dictionary-like data object such that you can give it the word to look up and it gives you the definition. Which of the following would create such an object and log a look-up to the console?
262. The following one line function will return true if str is a palindrome; otherwise, it returns false. function isPalindrome(str) { str = str.replace(/\W/g, '').toLowerCase(); return (str == str.split('').reverse().join('')); }
263. What's the output? (function() { var a = b = 1; })(); console.log (typeof b);
264. What values are assigned to x and y: var x = (0.1 + 0.2) == 0.3; var y = (0.1 + 0.1) == 0.2;
265. What value is assigned to x: var x = (1, 2, 3);
266. What's the output? Explain your answer. console.log(0.1 + 0.2); console.log(0.1 + 0.2 == 0.3);
267. Value of the variable `c` at the end of this script? var a = 1; var b = 2; var c = a || b;
268. what is the type of i? var i = NaN;
269. What does this line display? alert(typeof(Array));
270. What's the output? console.log('papa'.replace('p', 'm'));
271. The enumeration order becomes implementation dependent and non-interoperable if :
272. What's the output? var x = 8 + 8 + '8' + 8 + 8; console.log(x);
273. If we don’t want the script to write page content, under which HTML tag should the JS tag be placed?
274. var x = 3 && 4; What is x?
275. JavaScript only hoists declarations, not initializations.
276. The “var” and “function” are
277. How can I get sum to be the sum of this array, var arr = [0,1,2,3]?
278. What does return do?
279. In HTML, JavaScript code must be inserted between <script> and </script> t
280. The keyword or the property that you use to refer to an object through which they were invoked is
281. Which company developed JavaScript?
282. Consider the following statements var count = 0; while (count < 10) { console.log(count); count++; } In the above code snippet, what happens?
283. Which JavaScript operators would be most helpful in writing code to force a choice between seven options:
284. 0 == '' True or False?
285. How can you get the square root of 2 in JavaScript?
286. How many types of arguments are passed to an error handler:
287. var s = ~function(d) { return d+s; }(10); What is 's' value?
288. On https://www.google.com/?gws_rd=ssl#q=test. What does 'window.location.hash' return
289. What is the use of void(0) ?
290. What is result of 1+1+typeof(typeof(null))?
291. What does the following statement declares? var myArray = [[[]]];
292. The catch statement ...
293. var a = {a:1}; var b = {b:1}; var c = a; console.log(c==a);
294. Why does JavaScript subset disallow == and !=?
295. In JavaScript, functions are considered to be just another value. Why ?
296. var total = 0; var it = { '1':2, '3':1, '4':3 }; for (i in it) total += it[i]; What is 'total' value?
297. var data = ['A', 'B', 'C', 'D']; data.unshift('X'); data.push('Y'); What does data look like?
298. JavaScript Code can be called by using
299. What return this function : function myFunction(p1, p2) { return p1 * p2; }
300. How do you write 'Hello World' in an alert box?
301. Between JavaScript and an ASP script, which is faster
302. What's the output? for (var i = 0; i < 5; i++) { (function(x) { setTimeout(function() { console.log(x); }, x * 1000 ); })(i); }
303. function locald() { var d = 6; console.log('d inside function: ' + d); } locald(); console.log('d outside function: ' + d); What will be value of d in or out of the function;
304. Output when the following code is executed? console.log(false == '0', false === '0')
305. Which can have a different value depending on who invoked the function accessing it?
306. for the following code: function foo() { var funcs = []; for (var i = 0; i < 10; i++) { funcs.push(function () { alert('value of i is ' + i); }); } return funcs; } var funcs = foo(); funcs[0](); what will be alerted?
307. What will the below operation give you? var a = 14 var b = 9 console.log(a & b)
308. What would be printed to the console? function foo(arg) { console.log(Math.pow(this, arg)) } setTimeout(foo.bind(5, 2), 0); console.log('Done');
309. var x = 1.0; typeof x;
310. var myObject = { foo: 'bar', func: function() { var self = this; console.log('outer func: this.foo = ' + this.foo); console.log('outer func: self.foo = ' + self.foo); (function() { console.log('inner func: this.foo = ' + this.foo); console.log('inner func: self.foo = ' + self.foo); }()); } }; myObject.func();
311. What is the type of n? var n = 1121212.233333333; typeof n;
312. Which statement about hoisted declarations in Javascript is true? If a value is assigned to a variable during the declaration (example: var x = 10;) then ...
313. What is a potential pitfall with using typeof bar === 'object' to determine if bar is an object?
314. Which one is NOT the attribute of the property of object?
315. Javascript is an________ language
316. console.log([] == true)
317. The term 'javascript closure' refers to:
318. How it will be evaluated ? null == undefined
319. var self=this; self.color='red'; self.getColor=function(){ return this.color; } self.getColor.call({color:'white'})); What is the return value?
320. What is the original or first name of javascript?
321. How can you add a property to an Object that is not enumerable in a for...in loop?
322. What are the primitive data types in Javascript?
323. Output of the code: var a = 90100; function someFunc(){ if(false){ var a = 1; } else { var b = 2; } console.log(b); console.log(a); //(1) } someFunc();
324. If var a = 10, what will the result be of b with following syntax var b = a === 10 ? 'Sheldon' : 'Moonpie';
325. What's the output? function myFunction(param) { return arguments[1] || param; } myFunction(123, false, 'test')
326. What is newRay equal to at the end of the following code? var ray = []; ray['0'] = 1; ray['x'] = 2; var newRay = [] for( var i in ray ) { newRay.push( ray[ i ] ); }
327. Which one is a valid syntax for a self-invokink fucntion?
328. What's the output? and why? (function(){ var a = b = 3; })(); console.log('a defined? ' + (typeof a !== 'undefined')); console.log('b defined? ' + (typeof b !== 'undefined'));
329. What the problem with the code ? function runner() { this.run = function() {} }; var runnerCollection = new Array(); for(var i = 0 ; i < 1000 ; i ++) { runnerCollection.push(new runner()); }
330. What does Date() for example return ?
331. What's the output? console.log({} + {});
332. function base(callback){ callback.call({msg:'hi'}) } function message(){ alert(this.msg) }; base(message); which is the value of alert?
333. Choose correct answer: 'If you delete an object prototype property, it will..........'
334. What is the use of isNaN function
335. What does Object.keys(x) return given the following x object. var x = { 'a': 1, 'b': 2 };
336. Choose from the following which is true about Javascript
337. Which is NOT a JavaScript Type?
338. Meaning of IIFE in Javascript ?
339. Correct syntax for declaring an object literal?
340. What will be logged into the console? var animals = ['moose', 'giraffe', 'unicorn']; animals.forEach(function(animal, index) { if (index === 2) { console.log(animal); } });
341. What methods, other than if-else/switch, can be used to execute conditional statements?
342. What is the value of foo? var foo = 10 + '20';
343. What is logged? if ('10' + 1 == 101) { var a = 'yes'; } console.log(a);
344. Return of this function? var a = 0, b = 1; function test(value) { return value; } test(a || b);
345. What's the output? var fruits = ['Banana', 'Orange', 'Apple', 'Mango']; fruits.shift();
346. What is the significance, and benefits, of including 'use strict' at the beginning of a JavaScript source file?
347. What does document.createElement do?
348. How do you check if a variable todos is an Array?
349. var a = 11 + ''11''; var b = a + 22; var c = a + b; c = ?
350. What is the principle of debouncing?
351. What does this line do? x = new Array(4,8);
352. Following statement evaluate to? 12 === ''12''
353. What is the index of 'horse' in the array below? [23, false, 'cat', 'horse', 0]
354. Suppose we have: var array = new Array(); var x = 'Value'; How can you add a value to an array in Vanilla Javascript?
355. In the expression y = '5' + 5;
356. Javascript is designed for the following purpose__________
357. Evaluate the result of c: var a = (NaN == NaN) ; var b = 0; var c = (a === b);
358. What's the output? (function(x) { return (function(y) { console.log(x); })(2) })(1);
359. The output for the code would be var a=5 , b=1 var obj = { a : 10 } with(obj) { alert(b) }
360. When iterating through an objects properties, which function should be used to check each property?
361. In the HTML code a div is present
362. To define var1 = 'AAAAAAAAAAAAAAAAAAAA' //20 times A Which of the following could be used
363. Which one returns current millisecond count?
364. what will be the VALUE and TYPE of i? var i = -Infinity;
365. Which is the optimal method of executing a for-loop?
366. How can you delete a variable in Javascript?
367. given the following code: var baz = 0; function foo() { alert(bar(baz)); var baz = 1; var bar = function(message) { return message + ' is ' + message + '!' } baz = 2 alert(bar(baz)); } foo(); what is the output?
368. for the following code: var baz = 0; function foo() { alert(bar(baz)); var baz = 1; function bar(message) { return message + ' is ' + message + '!' } baz = 2 alert(bar(baz)); } foo(); What gets alerted?
369. var colors=[{name:'red'}], car={name:'toyota'}; car.color=colors[0]; car.color.name='yellow'; Which is the value of colors[0].name?
370. What is logged? var x = (1 + '1') !== '11' || ('1' + 1) === 2; console.log(x);
371. Which is equivalent to: rowCount = rowCount + 1;
372. Which of these is not a JavaScript object?
373. What the value will be returned as a result of this function call? function foo () { return true ? false : null; };
374. Javascript primitives are literal objects.
375. What will .append() do in vanilla JavaScript?
376. Result of the following equality operations? '' == '0' 0 == '' 0 == '0'
377. Which dialog box is useful when you want to pop-up a text box to get user input?
378. What's the output? (function(){ var a = b = 3; })(); console.log(' a defined? ' + (typeof a !== 'undefined'));)) console.log(' b defined? ' + (typeof b !== 'undefined'));))
379. What return the html element of a document?
380. What's the output? console.log( 'A' - 'B' + 2);
381. What calls the debug function?
382. Math.floor(4.94291481249124); returns
383. How do you get the current date in JS?
384. JavaScript is a language that is
385. Outcome of the two alerts below? var foo = 'Hello'; (function() { var bar = ' World'; alert(foo + bar); })(); alert(foo + bar);
386. function aaa() { return { test: 1 }; } alert(typeof aaa()); what does the above alert?
387. Which keyword defines the alternative path to take in a conditional statement?
388. What does the code write to the console? var x = false; if (x && console.log('hello')) { console.log('done'); }
389. Which is not a way to construct an array in JavaScript?
390. How do you create an empty array using literal notation?
391. What is the 'if' statement is used for?
392. What is the value of x? var a = 'A'; var x = a.concat('B');
393. Which character combination is used to create a single line comment?
394. Which character represents the assignment operator?
395. Which keyword is used to begin a conditional statement?
396. Which character ends a JavaScript statement?
397. What is string concatenation?
398. What is the var statement used for?
399. What does foo() return? function foo(){ var tmp = 'one_two_three_four_five' return tmp.replace(/_/g, '+'); }
400. Which is NOT a valid arithmetic operator?
401. What is the logical not operator in JavaScript?
402. What is the value of x? var obj = {}; obj['function'] = 123; x = obj.function;
403. Is this a valid multidimensional array? var myArray = [[1,2,3], 'Hello', [6,7,8]];
404. What does the try statement do?
405. What is the result? var a = 'Hello'; if (true) { var b = a; } var c = b;
406. How do you specify code that will be executed whether an exception is thrown or not?
407. Which enforces strictness to a scope?
408. Which of these is NOT a type of Error?
409. What defines a local scope?
410. Correct method for creating an empty array?
411. Result of the following code? var someCode = 'Math.ceil(5.5)'; var o = eval(someCode); console.log(o);
412. How do you access a property of an object?
413. What happens when you throw an exception in the catch block, using nested try-catch blocks? For example: try { try { throw 'Inside Exception'; } catch (ex) { throw 'exception in inner finally'; } } catch (ex) { console.log('Outer Catch: ' + ex) }
414. Result of the following code? var my = { name: 'Hello', count: 0 }; my.isValid = true; console.log(my.isValid);
415. How could you read the first character in a string?
416. What does the following code generate? var x = new Date();
417. Which starts a 'while' loop?
418. What kind of standard pattern is this code? var x = (function () { var y = 0; return { count: y }; })();
419. Which statement lets you create custom exceptions?
420. How do you construct a RegExp object?
421. Assuming that each code is called with: 'var say = sayHello('Mary Jane');', which one is a closure?
422. Which is a method of a RegExp object?
423. Following code evaluate to? var arr = [1, 2, 3, 4]; arr.indexOf(2);
424. How would you iterate over the following object? var my_data = {a: 'Ape', b: 'Banana', c: 'Citronella'};
425. What standard pattern is the following code? var x = function () { var y = 0; this.getCurrentCount = function () { return y; } }
426. Are the parameters of a function checked?
427. What construct generally used for in JavaScript? (function () { // ... })();
428. What's the output? (function () { 'use strict'; var x = 'hello'; })(); x = 0; console.log(x);
429. Which character combination is used to alter the order of operations by grouping expressions?
430. Which statement about JavaScript REFLECT object is NOT correct?
431. Which is the correct syntax of the Object.getOwnPropertyDescriptor method that is used for querying the full information about a property?
432. What's the output? var x = 5; var y = 0; document.write( let(x = x + 10, y = 12) x+y + ','); document.write(x+y);
433. In relation to object oriented JavaScript, for which option no wrapper objects are provided?
434. Which DOM object can be used to determine the resolution of the screen?
435. Which object is the top-level object in the JavaScript hierarchy?
436. Which is the correct output of the given code? var a = 20 + 'Example' + 10 + 'Test'; var b= 20 + 10 + 'Test' + 'Example' ; document.write(a, ''); document.write(b);
437. What's the output? 'use strict' class Xw{ constructor(t, p) { this.t = t; this.p = p; } pp() { var x=49; var c = 21; if(x=7) c++; else if(x>6) c=c+8; else c=c*4; document.write(c++ + this.t + this. p*2); } } var Obj1 = new Xw(19,29); Obj1.pp();
438. A function becomes a generator if it contains one or more yield statements.
439. What's the output?
440. Which is the correct syntactical representation of a generator expression in JavaScript?
441. What's the output? function* as( limit = Infinity ) { let a = 0, b = 1; while( a < limit ) { yield a; [a, b] = [b, a + b]; } } var pp=3 let iterator = as( 10 ); for(var prop of iterator){ pp=pp+23 } var f = (x)=>10+x console.log(f(10) + pp)
442. What's the output? 'use strict' class Xw{ constructor(a, b){ this.a = a; this.b = b; } tt() { var x; var c = 3; for(x=37; x!==0; x&=(x-1)) c++; document.write(c++ + this.a + this. b + 2 *2); } } var Obj1 = new Xw(23.5,26.5); Obj1.tt();
443. What's the output? var a = 5; var b = 2; var c = a / b; var c = a * b var c = a % b var c = a + b * a; document.write(c);
444. Which method is not a valid Array object method in JavaScript?
445. What's the output? var str = 'Example, JavaScript, Test'; var res = str.substring(6,15); document.write(res);
446. What will the function NaN return for the condition NaN == NaN?
447. What's the output?
448. Which statement regarding let in JavaScript is not correct?
449. In relation to JavaScript prototype, which method is used for returning an array of all own property names?
450. Analyze the code using the source property of Regular Expressions. What's the output?
451. What's the output? 'use strict' class Sf{ success_failure() { var a = 28, s=0, i ; for(i=1;i<=a;i++) { if(a%i==0) s=s+i; } if(s!=a*2) document.write('failure') ; else document.write('success'); } } var pj = new Sf(); pj.success_failure();
452. In relation to object oriented JavaScript [[Prototype]] property, which statement is correct?
453. Which property of a JavaScript Array object is only present in the arrays that are created by regular expression matches?
454. While using JavaScript, which can be used to return a number between 0 and 50?
455. Which JavaScript object is used to store unique values of any type?
456. With regard to Math object in JavaScript 1.8, which are true?
457. Purpose of the assign() method?
458. What will be printed after execution of following JavaScript code? var var1 = 10; document.write('First Value: ' + var1 + ' and Second Value: ' + var2); var var2 = 20;
459. Which method is used to return the primitive value of a Boolean object?
460. Which method of Int8Array object is used for testing if all array elements pass the test given by a function or not?
461. Correct syntax of DataView view of JavaScript?
462. Which methods can accept negative indexes?
463. What we can use to restart the inner most loop in java script.
464. Which Javascript Regular Expression Character Class finds any non-digit character in a given string?
465. What's the output? var n=1; var a=33; var b; b = a<<4; b = a>>3; b = b + 2; while(b>=1){ n = n + b; b = b - 1; } function ab(n) { if (n < 2) { return n; } else { return ab(n - 1) + ab(n - 2); } } console.log(n + ab(9));
466. Which modifiers must be set if we use the Javascript lastIndex Object Property during pattern matching?
467. What's the output?
468. What's the output? 'use strict' class Abc{ constructor(t, p) { this.t = t; this.p = p; } test() { var x; var c = 0; for(x=7; x!==0; x&=(x-1)) c++; console.log(c++ + this.t + this. p); } } var Obj1 = new Abc(10.5,20.5); Obj1.test();
469. What's the output? Object oriented Javascript() 'use strict' class Art{ succ() { var i=3,j,k=0; for(j=i;j<=7;j++) { k=j+i; if(k>=7) { k=k+3; } else { k=k-2; } } document.write(k-2 +''); } } var waj = new Art(); waj.succ();
470. Correct method for getting the date of February 1 of the current year into a variable called 'newDate'?
471. Name the different primitive data types of JavaScript ?
472. Which is not a valid JavaScript operator?
473. Which javascript method can be used to create or modify the attribute properties
474. While working with JavaScript Page Redirection, which is an invalid method of the window.location object?
475. In relation to object oriented JavaScript, which are the correct attributes of the object properties?
476. What's the output? var str1 = 'Hi world'; var str = 'Apples are round, and apples are juicy'; var sliced = str.slice(5, -2); var text =`Apple \nJuice` var raw_text = String.raw`Apple \nJuice` console.log(str1.valueOf()); console.log(raw_text) console.log(sliced); console.log(text)
477. What's the output? s2 = new String('2 + 2') document.write(eval(s2));
478. What's the output? var main = function() { var i=2,j=0,k=0,m=1.5,s=0; while(i<=3) { j=1; while(j<=4) { k=1; while(k<=4) { if(k%2!==0) { s=s+i+j+m; k++; } else { k++; m++; } } j=j+2; m++; } i++; m++; } console.log(s); } main();
479. function test(){ return { test:1 }; } alert(typeof test()); What will be the above alert ?
480. Which result is returned by the JavaScript operator 'typeof' for the keyword 'null'?
481. Which method is used to add and/or remove elements from an array and modify them in place?
482. Which function of the Object constructor with regard to JavaScript 1.8 returns the array of names of only enumerable properties of the given object?
483. In relation to object oriented JavaScript, which option can be used as the value of F.prototype?
484. In relation to sealing an object globally, which methods returns true if adding, removing, and changing properties is forbidden and all the current properties are configurable: false, writable: false?
485. Using DATE object which call a function based on elapsed time?
486. var a = [2, 5, 12, 16, 23, 35]; XXXX function abc( YYYY ) { return val > 20; } Which option will replace XXXX and YYYY in order to generate 4 as an output?
487. What's the output? var str = /u/.exec('I am the best friend!'); console.log(str);
488. What's the output? var test = function test(){ console.log('2' - - '2'); }; test();
489. Which are invalid usage(s) for a web worker in JavaScript? 1. Making use of the window shortcut to get the current global scope in a web worker. 2. Trying to access data in DOM directly with a web worker.
490. What's the output? var test = function test(){ console.log(window.location === document.location); }; test();
491. What's the output? var a = /xy/i, b = new RegExp(a, 'g'); console.log(a.test('xy')); console.log(b.test('xy')); console.log(a.test('XY')); console.log(b.test('XY'));
492. What's the output? var x=1; function f(x) { if (x === 0) { return 1; } return x * f(x-1)+2; } console.log(f(8));
493. What's the output? console.log(null == undefind);
494. Timer value can be cleared using which functions in JavaScript?
495. Which is not a JS window method?
496. Which are correct about the Prototype Pattern? 1. It always returns non-initialized objects. 2. It is also referred to as the Properties pattern. 3. It is accessible by methods using this keyword.
497. Which is not the part of JavaScript errors handling?
498. Which one could you do using JavaScript?
499. Are the following two statements the same? object.property object[''property'']
500. Which are valid JavaScript methods?
501. You are allowing the user to upload image files. You want to be able to capture the attributes of the image such as width and height using JavaScript. How would this be possible?
502. Difference between calling a JavaScript function directly like onclick = 'a()' and onclick='JavaScript:a()' where a() is a function written in JavaScript?
503. You've embedded the document.write() method to write some text within a pair of table tags. Upon loading the file, however, you get some garbled junk on the page where that text should be. What could be the reason for this?
504. Consider the following JavaScript alert: You want the user to see the above message upon opening the page. How will you implement this?
505. What does the following statement do? document.title = 'JavaScript';
506. which is correct in order to send a HTML form post request using XMLHttpRequest?
507. Result of C given code? var a = '1'; b = 2 * a; c = typeof(b);
508. Value of C in given code? function a(version) { this.version = version; } a.prototype.version = '1.8'; var b = new a('1.8.1'); delete b.version; var c = b.version;
509. Which statement defines a regular expression?
510. Which property contains user agent string of web browser?
511. Which statement is true?
512. What's the output? var somevar; alert(typeof(somevar));
513. .... property refers to the window that opens another window.
514. Which method can you use to convert JSON data in responseText to JavaScript object?
515. Create the XMLHttpRequest is the same in all Internet Explorer browser versions.
516. Which ways can you use to attach click event handler to id1 div tag on all browsers?
517. Result of c? function a(name) {this.name = name;} var b = new a(); var c = typeof(b.name);
518. Consider the code: function a() {} function b() {} Which statement makes 'a' object inherit from 'b' object?
519. In the web browser, global objects are properties of window object.
520. Value of c in the following code? function a() {} var b = a(); var c = typeof(b);
521. In the W3C model, if you attach an anonymous function as an event handler of an element using addEventListener, how can you remove that anonymous function?
522. What's the output? function f(a, b, c){return true;} var a = f.length;
523. Which way can you use to prevent default action when a user clicks on a link on any browser?
524. Which event object properties can you use to check whether that event is allowed to prevent default behavior or not?
525. Result of type of (Infinity); statement?
526. What's the output? function a() { alert('Outer function!'); return function(){ alert('Inner function!'); }; } var a = a(); a();
527. Value of document.referrer if a user opens the page from a bookmark?
528. What's the output? function test() { return 'Hello'; } alert(test());
529. function a(a1) {this.a1 = a1;} a.prototype.a2 = 'Prototype property'; var c = new a(); Which statement returns true?
530. Which comparison will return false in equal comparison (==)?
531. What's the output? self == window;
532. Which regular expression method can you use to check whether there exists a pattern within the given string or not?
533. Difference between mouseenter and mouseleave event?
534. Functions to test whether an element has any children or not?
535. Which statement can you use to reload a page?
536. Good reason to avoid user agent sniffing?
537. Resulting value of c in the code? var a; function b(){ var b = 'b' a = function(){ return b; } } b(); c = a();
538. Which events can fire if a user doesn't use the mouse?
539. Result of the following comparison? null == null
540. In the W3C model, which method can you use to prevent default behavior of an event?
541. Value of c in the following code? function a() {} a.prototype.version = '1.8'; var b = new a(); var c = b.prototype.version;
542. What's the output? ( function(name){ alert(name + ' programming language'); } )(' JavaScript ');
543. What's the output? function a() {alert(x);} function b() {var x = 'function b'; a();} b();
544. screen.pixelDepth is not available in Internet Explorer 7.
545. In javascript, functions can be declared without names
546. What's the output? function a() { var x = []; var i = 0; a[i] = function(){ return i; } i++; alert(a[0]()); } a();
547. Which function can you use to test whether an object was created with a specific constructor or not?
548. Which operators is valid JavaScript operator(s)?
549. Value of b? var a = Array(5); var b = a[0];
550. window.frames is a collection of all of the ... in the current page.
551. What's the output? var a = {f: 'object'}; var b = {f: 'object'}; var c = a == b;
552. Consider the code snippet given below: var a = {a1: 1, a2: 2}; var b = 0; for (i in a) { b += a[i]; } Which is true?
553. What's the output? var a = document.getElementById('id1'); a.onclick = function1();
554. What's the output? var a = [1, 2, 3]; delete a[1]; alert(a[1]);
555. Which methods and properties can you use to change CSS class of an element?
556. Value of C? function a(){return a.caller;} function b(){return a();} c = b();
557. Assume that the header has the following code snippet: What's wrong with this code snippet?
558. Which function can be used to stop an event from propagating if you're using a W3C-compliant browser?
559. Result of c in the following code snippet? var a = '1'; b = 2 * a; c = typeof(b);
560. Which screen object property returns the total width of the screen?
561. You can map CSS properties to style properties by ... .
562. One way to add functions to an object is by ... .
563. Consider the following code snippet: var a = document.getElementById('id1'); a.onclick = function1; a.onclick = function2; Which function will be executed if a user clicks on id1 element?
564. What's the output? var vName='Kodak Camera' vName.indexOf('Camera')
565. Which is not a valid HTML event?
566. Which is not a valid string method?
567. How would you randomly choose an element from an array named myStuff if the number of elements changes dynamically?
568. Consider the following scenario: Image thumbnails are displayed on a page. Upon clicking a thumbnail, the image is displayed in its actual size. The thumbnails aren't clickable, unless they are completely downloaded. What event can be used to prevent the user from clicking on the thumbnails until they are completely downloaded?
569. Consider the following image definition: Which will change the image to 'companylogo2.gif' when the page loads?
570. Which will detect which DOM element has the focus?
571. Which will detect if the browser supports a certain CSS property?
572. Correct way to resize an iframe based on content?
573. Which is not a correct way to empty the array a?
574. Which is the most secure and efficient way of declaring an array?
575. What is the error in the statement: var charConvert = toCharCODE('X');?
576. Performance-wise, which is the fastest way of repeating a string in JavaScript?
577. Which is correct values of variable, and why? VariableA = [6,8]; VariableB = [7,9]; variableC = variable + variable;
578. What's the output?
579. Which is the correct method to use, in order to know the name of both the Object and Object Class in JavaScript?
580. What is the purpose of while(1) in the following JSON response? while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false'],['remindOnRespondedEventsOnly','true'],['hideInvitations_remindOnRespondedEventsOnly','false_true'],['Calendar ID stripped for privacy','false'],['smsVerifiedFlag','true']]]]
581. Click here! What does 'return false' do to this onclick event?
582. Which statement about the ‘new’ keyword is incorrect?
583. Which are correct closure functions?
584. Final value of the variable apt? Var apt=2; Apt=apt<<2;
585. How does the this keyword work within a JavaScript Object literal?
586. Var profits=2489.8237 Which produces the following output? Output : 2489.824
587. Which code snippet renders a button invisible?
588. Which object can be used to ascertain the protocol of the current URL?
589. Why does (0 <5 < 3) return true?
590. Consider the following code: Var vNew=new Date() Which options will return true?
591. What's the output? Var container = { someKey: 3, someOtherKey: 'someObject', anotherKey: 'Some text' }; If ('someOtherKey: in container) { Alert(true); } Delete container[“someOtherKey”]; If (container[“someOtherKey”] === null) { Alert(false); } If (container[“someOtherKey”] === undefined) { Alert(true); } If (container.someOtherKey === Undefined) { Alert(false); } If (container.someKey === undefined) { Alert(true); } Delete container['someKey']; If (container.someKey === 3) { Alert(true); }
592. Which will correctly split 'str'?
593. The following are sample code on how to loop through JavaScript object literals with objects as members: Var validation_messages = { 'key_1' : { 'your_msg' : 'hello world' } , 'Key_2' : {'your_name' : 'billy', 'your_msg' : 'foo equals bar' } } Which are invalid native JavaScript codes?
594. Consider the following code snippet: var myJSONObject = {'ircEvent': 'PRIVMSG', 'method': 'newURI', 'regex': '^http://.*'}; What is the best way to remove the property 'regex', so the result would be this code snippet? myJSONObject == {'ircEvent': 'PRIVMSG', 'method': 'newURI'};
595. Which objects in JavaScript contains the collection called 'plugins'?
596. Consider the following image definition: Which will change the image to companylogo2.gif when the page loads?
597. When setting cookies with JavaScript, what will happen to the cookies.txt data if the file exceeds the maximum size?
598. Which is not a valid method in generator-iterator objects in JavaScript?
599. How can a JavaScript object be printed?
600. How can the operating system of the client machine be detected?
601. What's the output? function testGenerator() { yield 'first'; document.write('step1'); yield 'second'; document.write('step2'); yield 'third'; document.write('step3'); } var g = testGenerator(); document.write(g.next()); document.write(g.next());
602.
Consider the following variable declarations: var a="adam" var b="eve" Which of the following would return the sentence "adam and eve"?
603. Which one changes an image on the page?
604. Which will check whether the variable vRast exists or not?
605. An image tag is defined as follows: The purpose of the ImageChange() function is to change the image source to Image2.jpg. Which of the following should the ImageChange() function look like?
606. How can created cookies be deleted using JavaScript?
607. Analyze the following code snippet which uses a Javascript Regular Expression character set. What will be the output of this code?
608. Which can be used for adding direct support for XML to JavaScript?
609. Which is true regarding importing JavaScript files inside of other JavaScript files?
610. Which will remove a selection option from the code below? Remove option1 option2 option3 option4
611. Consider the following JavaScript function to change the color of the text box named txtName: function color(col) { document.forms[0].txtName.style.background=col } Which of the following will change the color of the text box to green, as long as the user is pressing a key?
612. Which one can be used to determine which page of the website has been most recently modified?
613. Which can be used to escape the ' character?
614. Which correctly uses a timer with a function named rearrange()?
615. Which object can be used to manipulate the user's list of visited URLs?
616. Which correctly sets a class for an element?
617. Which determines whether cookies are enabled in a browser or not?
618. Which will implement a singleton pattern in JavaScript?
619. Correct way to stop setInterval() from calling a function in JavaScript?
620. How can properties be added to an object class?
621. Which choice will change the source of the image to 'image2.gif' when a user clicks on the image?
622. Which Array method in JavaScript runs a function on every item in the Array and collects the result from previous calls, but in reverse?
623. What would be the value of 'ind' after execution of the following code? var msg='Welcome to ExpertRating' var ind= msg.substr(3, 3)
624. Which are true regarding the 'this' keyword in JavaScript?
625. Which will list the properties of a JavaScript object?
626. Consider the following JavaScript validation function: function ValidateField() { if(document.forms[0].txtId.value == '' '') {return false;} return true; } Which will call the function as soon as the user leaves the field?
627. In an HTML page, the form tag is defined as follows:
628. Which statement is correct?
629. What would be the use of the following code? function validate(field) { var valid='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; var ok=''yes''; var temp; for(var i=0;i
630. Which will toggle a div element's background color? Toggle
631. In JavaScript, the encodeURI() function is used to encode special characters. Which special characters is/are an exception to that rule? A. £ B. € C. @ D. $
632. Which one shows an alert for an empty string? var a = '''';
633. Which will correctly get the length of an object?
634. What's the output? document.getElementById('banana').className = document.getElementById('banana').className.replace( /(?:^|\s)apple(?!\S)/g ,'e' );
635.
636. Which option is the most maintainable way to attach JavaScript functionality to an HTML element?
637. Which will return all HTTP headers?
638. Top most object in the object hierarchy?
639. Which is true about setTimeOut()?
640. What does the + sign in front of a function name mean in JavaScript?
641. Which is not a valid Date Object method in JavaScript?
642. Which event can be used to validate the value in a field as soon as the user moves out of the field by pressing the tab key?
643. Is the following statement regarding expression closures in JavaScript true or false? The syntax function(x) {return x*x;} can be written as function(x) x*x.
644. How can the user's previously navigated page be determined using JavaScript?
645. Which statement regarding this String prototype is correct? String.prototype.doSomething = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; };
646. Choose another way to write x ? a = b : a = c
647. Which is incorrect regarding Strict mode in JavaScript?
648. Which are true regarding the code below?
649. Consider the following code: Which is the best method to get the line number of the form's text area?
650. What's the output? contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return false; }
651. Default setting for the expires attribute of the document.cookie property?
652. Given the following window.open function: window.open(url,name,'attributes') How can it be ensured that different URLs are opened in the same window?
653. Which option represents the correct length when alert(Emp..*.length()); is applied to the following code? var Emp = Mark Linux Firefox JavaScript Python
654. Which is not a valid method for looping an array?
655. Which will include a JavaScript file in another JavaScript file?
656. Which shortcut can be used for writing multiple document.write statements?
657. Given a p element with some text content, which of the following code snippets sets the background color of the text to yellow, its color to red, and its font size to 20px?
658. Which can be used to write a JavaScript function that will accept user input?
659. The following functions are for encoding URL parameters in Javascript. Which function escape converts non-ASCII characters into its Unicode escape sequences, like %uxxx?
660. Which are not valid HTML events?
661. Best reason for not using 'for...in' with array iteration?
662. Which is not a valid JavaScript operator?
663. Which is an invalid function declaration?
664. Which is used to solve the problem of enumerations in JavaScript?
665. Which will determine if the user's browser is named 'Netscape'?
666. Which code snippet will trigger an input type='file' attribute when an element with a 'newbtn' ID is clicked? Upload
667. Which are true regarding JavaScript and multi-threading/concurrency?
668. Difference between call() and apply()?
669. Which is a good reason why JavaScript variables would start with a dollar sign ($)?
670. Final value of the variable bar in the following code? var foo = 9; bar = 5; (function() { var foo = 2; bar= 1; }()) bar = bar + foo;
671. Which will correctly check if a variable is undefined in JavaScript?
672. Which 'if' statement is correctly used to get the size of both 'variable1' and 'variable2' objects? var variable1 = {'name':'theName', 'address':'theAddress','age': '18'} var variable2 = ['theName','theAddress','18']; variable1["name"] = "theName2"; variable1["name"] = "theName3"; variable1["name2"] = "theName4"; variable1["name2"] = "theName5"; Object.size = function(importer) { var exporter = 0, key; for (key in importer) { if (importer.hasOwnProperty(key)) exporter++; } return exporter; };
673. Which uses the 'with' statement in JavaScript correctly?
674. Which can be used for disabling the right click event in Internet Explorer?
675. Why does Google prepend while(1); to their JSON responses?
676. An HTML form contains 10 checkboxes all named 'chkItems'. Which JavaScript function can be used for checking all the checkboxes together?
677. Which option is used to access the attributes in E4X?
678. Which built-in function is used to access form elements using their IDs?
679. Consider the following code snippet:
680. Which is not a JavaScript string method?
681. When toggling a variable, its cycle must be 0 and 1. When the variable's active value is 0, the next value should be 1, and when the variable's active value is 1, the next value should be 0. Considering the scenario above, which of the following is correct?
682. What's the output? var obj = { 'first':'first', '2':'2', '34':'34', '1':'1', 'second':'second' }; for (var i in obj) { alert(i); };
683. Correct way to create an XML object in E4X? A. var languages = new XML('JavaScriptPython'); B. var languages XML = new XML('JavaScriptPython'); C. var languages = JavaScript Python ;
684. Which will correctly detect a touchscreen device?
685. Which will correctly detect browser language preference?
686. Which code shows the correct way to detect an array that does not contain a specific value?
687. Which modifiers must be set if the JavaScript lastIndex object property was used during pattern matching?
688. What is the cleanest, most effective way to validate decimal numbers in JavaScript?
689. Which code snippet returns '[object object]'?
690. Which are JavaScript unit testing tools?
691. Which is not a valid code for redirect to stackoverflow.com?
692. Best way to show both single and double quotes in the same sentence?
693. Consider the following code: var setter=new Object() setter.color='blue' How would you delete the color property of the variable seter?
694. What does a 'for...in' loop do?
695. Correct way to redirect the default login and registration page URL to a custom login and registration page URL?
696. Correct way to print the slug property of $firstTag object in this code snippet? $tags = wp_get_post_tags($post->ID); $firstTag = $tags[0];
697. Which command can change the ownership of WordPress directory to www-data (for Apache)?
698. Which is an example of a WordPress plugin that provides multilingual capabilities?
699. Which code snippet can be used to create custom POST status in wordpress 3.0 +?
700. Which will correctly add custom mod rewrite rules to .htaccess from a WordPress plugin?
701. Which functions are used to add administration menu item in WordPress ?
702. Which code snippet will create plugins back-end page without showing it as menu item?
703. How can a post ID be retrieved from the permalink?
704. Which will correctly load localized (translated) text for a WordPress plugin?
705. Which conditional tag checks if the dashboard or the administration panel is attempting to be displayed by returning 'true' (if the URL being accessed is in the admin section) or 'false' (for a front-end page).
706. Quick way to move a Wordpress website from one server to another?
707. BEST option to integrate Facebook into Wordpress registration/login ?
708. Which function below is required to create a new taxonomy?
709. Which methods can be used to make permalinks SEO friendly?
710. What is the first action you need to take for enabling the WordPress multisite (MS) feature?
711. Correct way to filter the content for a few posts?
712. Which actions cannot be hooked in with add_submenu_page() function?
713. On which database can WordPress be installed by default?
714. Which function can be used to create a WordPress page?
715. BEST way to get last inserted row ID from Wordpress database ?
716. Which functions are used when adding CSS and jQuery codes on a WordPress plugin?
717. Is super cache a built-in plugin of WordPress?
718. Correct way to get WordPress Post ID from the Post title?
719. How can a custom content filter be added?
720. One possible way to collect realtime statistics about traffic on a WordPress site is:
721. Which WordPress Multisite function allows for getting content from one blog and display it on another?
722. Are categories and tags available for pages? Note: Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can't assign them the same slug.
723. Which will return the current plugin directory in WordPress?
724. Database privileges that are required for WordPress?
725. Correct way to retrieve a featured image from a post?
726. A possible way to allow the display of several authors' names on one post is to ...
727. How can the upload media panel be included in a Wordpress template/plugin?
728. .... can manage their own profiles, but can do virtually nothing else in the administration area.
729. Correct way to assign a category to a Wordpress post?
730. Which is correct for sorting tags of the 'WordPress Tag Cloud', when those tags contain special characters?
731. Which can be used to create a folder if it does not already exist on server through WordPress?
732. Which will show the most recent post (by date) from a custom taxonomy?
733. Correct code to get an array of every image uploaded to a particular post?
734. Which will give the option to add inline Ajax for comment posting?
735. Which will hash a string/password to its md5 equivalent?
736. How can a user be found through its meta data?
737. You can limit the number of revisions WordPress stores by _____ Note: Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can't assign them the same slug.
738. .... can publish, edit, and delete their own posts. They cannot write pages. They can upload some kinds of media files, and they are allowed to use only the limited set of HTML tags.
739. How use of html code in comments be disabled?
740. How many built-in user roles does WordPress have?
741. Meta tags can be added to WordPress pages by ....
742. Which is a Online Code Coloring Service?
743. How can widgets for individual pages be managed within the page editor?
744. Right order (by priority in use) to display page in Template Hierarchy?
745. How can the class name of a sub-menu be changed in the wp_nav_menu?
746. Which cannot be used to output content from WordPress?
747. Which deprecated functions are still in use in WordPress?
748. Which will return only the src attribute of an tag while using the post_thumbnail() function in WordPress?
749. How can a WordPress template be integrated inside a codeigniter framework using WordPress functions like wp_header,wp_footer,wp_sidebar?
750. .... can write their own posts but may not publish or delete them. Their HTML is limited to the set of allowed tags and they cannot upload media files.
751. What's the output?
752. What's the output?
It's like comparing apples to oranges.
It's like comparing oranges to oranges.
753. In which way MD5 hash does wordpress stores and represents?
754. User Level 1 converts to .... ?
755. Function to display the name of current page in wordpress?
756. Which role levels has the highest privilege?
757. Conditional tags can be used to .... .
758. Which code snippet removes the 'Home' link from the 'wp_nav_menu' ?
759. Which is an incorrect way to force www to a WordPress URL?
760. How can the Home link be disable from the Wordpress top nav?
761. How would you integrate WordPress Tiny MCE editor with a plugin?
762. Who of the following persons can read a post locked by password?
763. What should be done if a fatal error message 'Out of Memory' is received while adding a new post in WordPress?
764. Which will echo the base URL of a WordPress site?
765. Correct way to get content from Tinymce via javascript ?
766. Which will automatically create a page upon activating a WordPress plugin?
767. How can a plugin function be called using Ajax?
768. How can a featured image be added to a WordPress post programmatically?
769. Correct sequence of steps to adapt a WordPress plugin to a multisite?
770. Which theme file can be used to customize the 'page not found error' error page?
771. Correct way to change the admin URL to something else other than wp-admin?
772. From which version of WordPress can you choose your username during the installation process?
773. User Level 7 converts to .... ?
774. Image size limits can be set .....
775. Which snippet disable depreciated warnings in Wordpress like this one ? 'Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647'
776. Which JavaScript Regular Expression modifiers finds one or more occurrences of a specific character in a string?
777. Consider the following JavaScript alert: Which will run the function when a user opens the page?
778. What value would JavaScript assign to an uninitialized variable?
779. Consider the three variables: someText = 'JavaScript1.2'; pattern = /(\w+)(\d)\.(\d)/i; outCome = pattern.exec(someText); What does pattern.ignoreCase contain?
780. Which will turn a string into a JavaScript function call (case with objects) of the following code snippet?
781. Which Regular Expression pattern flag is not valid?
782. The statement navigator.platform indicates 'Win16' on user's computer that's running Windows NT. Which of the following is true?
783. Consider the three variables: someText = 'JavaScript1.2'; pattern = /(\w+)(\d)\.(\d)/i; outCome = pattern.exec(someText); What does outCome[0] contain?
784. If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it, which one will be displayed on top?
785. What value would JavaScript assign to an uninitialized array element?
786. Which one checks if an object has a specific property?
787. Which correctly explains the difference between a 'for...in' and a 'for' loop?
788. What's the output? document.alinkColor='green'
789. Select the following function that shuffles an array?
790. Consider three variables: someText = 'JavaScript1.2'; pattern = /(\w+)(\d)\.(\d)/i; outCome = pattern.exec(someText); What does pattern.global contain?
791. Consider the following scenario: The document.write() method is embedded to write some text within a pair of table tags. Upon loading the file, however, garbled text appears on the section of the page where the text should be. What could be the reason for this?
792. Which is not a valid HTML event?
793. Final value of the variable apt? var apt=2; apt=apt<<2;
794. Which is true for the code below? var object0 = {}; Object.defineProperty(object0, 'prop0', { value : 1, enumerable:false, configurable : true }); Object.defineProperty(object0, 'prop1', { value : 2, enumerable:true, configurable : false }); Object.defineProperty(object0, 'prop2', { value : 3 }); object0.prop3 = 4;
795. Which browser support a script tag's async attribute?
796. Which event can detect when the user highlights text within a text or textarea object?
797. What's the output? Public class test75 { Public static void main(string[] args) { System.out.printIn(new A(){{}}.tostring()); } } Class A { Public string tostring() { return getclass().getName(); } }
798. Meaning of obfuscation in JavaScript?
799. Which JavaScript Regular Expression object method is used to search a string for a specified value and return the result as or false?
800. Which code prints false?
801. Are the two statements below interchangeable? Object.property Object [‘property’]
802. Which best describes void?
803. Which statement regarding JSON is incorrect?
804. How can it be determined if JavaScript is disabled in the user’s browser?
805. A form contains two fields named id1 and id2. How can you copy the value of the id2 field to id1?
806. Consider the following code: Which one shows the correct values for 'variable1' and 'variable2'?
807. Which can be used to dynamically change the value of a tag?
808. While coding a loop, which statement can be used to ignore the rest of the statements, and continue with the beginning of the loop?
809. Which cannot be achieved using JavaScript?
810. Analyze the following code snippet. What's the output?
811. Which code snippet is more efficient, and why?
812. Which are true regarding 'window.onload' and ''?
813. What does the following JavaScript code do?
814. Which declaration is not valid?
815. Which will invoke the browser's Add To Favorite dialog box?
816. Which one shows the correct result for the code below? var arr = []; arr[0] = 'Jani'; arr[1] = 'Hege'; arr[2] = 'Stale'; arr[3] = 'Kai Jim'; arr[4] = 'Borge'; console.log(arr.join()); arr.splice(2, 0, 'Lene'); console.log(arr.join());
817. Which code snippet removes objects from an associative array?
818. Correct syntax for using the JavaScript exec() object method?
819. var p = {'p1': 'value1', 'p2': 'value2', 'p3': 'value3' }; Which produces the following output? output: p2 = value2
820. What's the output? public class Test15 { public static void main(String[] args) { VO a = new VO(2); VO b = new VO(3); swapONE(a, b); print(a, b); swapTWO(a, b); print(a, b); } private static void print(VO a, VO b) { System.out.print(a.toString() + b.toString()); } public static void swapONE(VO a, VO b) { VO tmp = a; a = b; b = tmp; } public static void swapTWO(VO a, VO b) { int tmp = a.x; a.x = b.x; b.x = tmp; } } class VO { public int x; public VO(int x) { this.x = x; } public String toString() { return String.valueOf(x); } }
821. The following codes are for comparing equality operators '==' and '===' in JavaScript. Which are the correct results?
822. Which method evaluates a string of JavaScript code in the context of the specified object?
823. What kind of Typed Arrays representation of the pixels does Canvas ImageData return when you call ImageData.data?
824. Most efficient way to clone a JavaScript object?
825. Which code sample will correctly search for the word 'for' in a string?
826. Which is a valid syntax to create a function?
827. What's the output? var x = 1; { var x = 2; } alert(x);
828. Method to call a function or evaluate an expression at specified intervals?
829. Which code snippet deletes cookie correctly?
830. Correct way to redirect to a URL in javascript?
831. What's the output? var foo = 10 << 1;
832. Which are true for Java script?
833. Which is not a JavaScript datatype?
834. How do you find the number with the highest value of variable a and b?
835. How can you convert a comma separated string variable txt into an array?
836. Which is not a valid JavaScript Assignment Operator?
837. What's the output? var result = (function(a) { return a*a; }(5.5)); alert(result);
838. What's the output? if(typeof(Storage)!=='undefined') { localStorage.age=5; sessionStorage.age=5; alert(localStorage.age + sessionStorage.age); } else { alert('Sorry, your browser does not support web storage...'); }
839. What's the output? /e/.exec('The best things in life are free!');
840. Which statement is incorrect regarding HTML5 Web Worker?
841. What's the output? var foo = function foo() { console.log(foo === foo); }; foo();
842. Which is incorrect way of instantiating a date?
843. How would you change the date to one week later assuming myDate is a date object?
844. Event that fires when the form element textarea loses the focus?
845. What's the output? var x=3; x=x<<3;
846. What will be the value of 'mystring' variable when the following code is executed? var fruits = ['Banana', 'Orange', 'Apple', 'Mango']; fruits.pop(); var mystring = fruits.join(' * ');
847. Which is not a mouse event?
848. do while (a < b) runs
849. Which method is used to get the current location of a user?
850. Which can be used to handle the user clicking on a node?
851. Which code snippet is best way to clear the canvas for redrawing?
852. What's the output? Boolean(6 > 5)
853. Which JavaScript class represents regular expressions?
854. Which is incorrect regarding localStorage and sessionStorage?
855. Correct regular expression to replace Mango with Apple in a string: var str = 'Eat Mango!';
856. Correct method to replace all occurrences of 'Foo' with 'Bar' in the following statement? var mystring = 'Replace Foo with Bar at Foo and Foo.';
857. When function name become optional?
858. Correct way to create a JavaScript array?
859. Correct way to read the 'age' property of a 'person' object?
860. How to concatenate the following strings in javascript? var foo = 'Lorem'; var bar = 'Ipsum';
861. A property of myobj is defined using
862. Correct JavaScript syntax to change the content of the HTML element with id 'header'?
863. Correct way to append a value to an array in JavaScript?
864. Javascript can be termed as which of the following?
865. How can you detect the client's browser name?
866. What's the output? function clickValue(){ alert(Math.round(-20.5)); } clickValue();
867. Document Methods in W3C DOM, supports all the methods available in Legacy DOM?
868. ... JavaScript is also called client-side JavaScript?
869. How do you round the number 3.14, to the nearest integer?
870. A property is the object oriented equivalent of:
871. Consider parsing a URL with the following code snippet? var reg = /(\w+):\/\/([\w.]+)\/(\S*)/; var url = 'http://www.myblog.com/'; var result = url.match(reg); if (result != null) { var path = result[1]; }
872. What's the output? X = 50 / 'Apple'; alert(x);
873. Which is not a valid JavaScript variable name?
874. Correct syntax to create a new object ‘car’ with the following attributes? Color = red Model = 2016 Weight = 500kg
875. What's the output? function sayHello() { 'user strict' for (x = 0; x < 10; x++) console.log(Hi John!');} sayHelo();
876. What's the output? function User(name) { this.name = name || 'Mike'; } var usr = new User('VRU')['location'] = 'John';
877. What's the output? ? var val = 'var global'; function constructFun() { var scope = 'var local'; return new Function('return val'); } constructFun()());
878. Legal event handlers for the image object?
879. What are the RegExp Properties as follows?
880. Regular-expression anchor has the following characters?
881. What's the output? var flg = true; console.log(flg + 1); console.log(flg + 'xyz'); console.log(flg + true); console.log(flg + false);
882. Which will correctly check if an object is an array?
883. The following global properties return a value and they have no properties/methods?
884. Document Properties in W3C DOM, supports all the properties available in Legacy DOM?
885. Javascript provides the following functions to be frequently used in animation programs?
886. The replacement string can include the following special replacement patterns?
887. Which are the valid JavaScript codes to obtain the number of milliseconds since the epoch?
888. Which functions determine whether the beginning of the param1 instance matches the param2?
889. Which statement is correct about null and undefined?
890. What do JS classes support?
891. XMLHttpRequest has the following properties?
892. There are several Navigator-specific methods which include the following?
893. What are the following EventTarget Methods?
894. The following code create Boolean objects with an initial value of false?
895. Every array method tests whether all the elements in an array passes, what are the correct statement about parameter Details?
896. The WheelEvent.deltaMode read-only property returns an unsigned long representing and the Permitted Constant values are?
897. The Error event is fired when progression has failed and it have the following Property's?
898. Consider the following code output? var name = 'falleyr*'; if (name == 'jolly') { name += '!'; } else if (name == 'falleyr**') { name += '!!'; } else { name = '!' + name; } name == 'falleyr***' console.log( name);
899. Right code for Function expression?
900. How you will do empty an array in JavaScript? var array = ['1', '2', '3', '4', '5', '6'];
901. What is printed in the console? for (let i = 0; i<5; i++) { console.log(i); } console.log(i);
902. Which code is self-executing anonymous function expression?
903. Which code samples creates an alert box with 'false' in it?
904. What will be the output when the following statement code is executed? if(true){ const a=1; console.log(a); a=100; }
905. When formal arguments value changes, what is the output of Arguments object? function myFunc(a, b) { arguments[1] = 20; arguments[2] = 79; console.log(a + ', ' + b); } myFunc(1, 2);
906. What are the Behavioral patterns as follows?
907. What's the output? (function() { var obj1 = new Object({name: 'Jacob'}); var obj2 = new Object({name: 'Alex'}); console.log(obj1 == obj2); console.log(obj1 === obj2); }());
908. What will be in the alert box? let a = {}; a.foo = 'bar'; let b = {a}; alert(b);
909. What's the output? ? var foo = 123e5; var bar = 10; var foobar = foo + bar; console.log(foobar)
910. How do you remove property a from this object? let a = {a:1, b:2};
911. How can you get the type of the variable?
912. What will be logged to the console? const a = new Promise(function (resolve, reject) { setTimeout(resolve, 100 * .9, '1'); }); const b = new Promise(function (resolve, reject) { setTimeout(reject, .9 * .0, '2'); }); Promise .race([a, b]) .then((value) => { console.log(value); });
913. What will be logged in console? const data = [{a: true, b: false}, {a: false, b: true}]; let result = false; let sample; while (sample = data.pop()) { result = sample.a; } console.log(result);
914. Select the event handlers that exist on the HTMLElement.
915. What is true about strict mode?
916. What kind of function is function* in JavaScript?
917. Which statements are true about web workers?
918. Valid states of the created Promise?
919. What does ~ mean in bitwise operation?
920. What will be the value of a? let a = -1 ? 'foo' ? null : -1 : 1;
921. What is TypeError?
922. What's the output? if we call f(3)? const f = (x, y = true) => x * y;
923. What's true about the document object in any environment?
924. What will be logged in the console? let a = { [ 'foo_' + (() => 1)() ]: 2 }; console.log(a);
925. What is the Promise?
926. How many yield keywords can be used in function* functions?
927. What does let mean in JavaScript?
928. What is true about JavaScript language?
929. Value of s.size after executing this code? let s = new Set(); s.add('aa').add('bb').add('cc').add('aa').add('bb')
930. How many operations can be done simultationsly with JavaScript?
931. Select options which create object type variables:
932. How often will message 'hey' be logged in console? setInterval(() => {console.log('hey')},1);
933. What's the point of code around the variable statement: (function() { var a = true; })();
934. Which statement about Promises is not correct?
935. What will be the value of a? let a = void function f() { let a = 1 - 2; let b = 2 - 3 + 1; if (a) { return true; } else if (b) { return false; } else { return null; } return -1; }();
936. What is JavaScript?
937. Select the existing event handler for DOM elements.
938. What's the output? var x = [typeof x, typeof y][1]; console.log(typeof typeof x);
939. What will be written in the alert box after executing the following code? ``` var a = 5; var b = 1; if(!!'false') { a = a + 5; b = 3; }; if(!!0) { a = a + 5; b = b + 2; }; alert(a+b); ```
940. Correct syntax for referring to an external script called 'test.js'?
941. Why do web programmers use node.js?
942. What will be returned if we call f(1);? const b = [1, 2, 3]; const f = (a, ...b) => a + b;
943. What will be the value of a? let a = 'a'; let b = 'b'; a = [a, , b] = [1, 2, 3];
944. Which function will return 10 when called like this: f(10);
945. Which event handlers can be used to create hover effect on HTML element?
946. What's the output? console.log(typeof a); console.log(typeof b); function a() { } var b = function () { };
947. Which example is correct of Local Scope Variable?
948. What is the value of b? let a = [1, 2, 3, 4, 5]; let b = [1, 2, ...a];
949. How can you remove all of an Element’s children from the DOM?
950. Is it possible using JavaScript, without 3rd party libraries, to select DOM elements with such selector: #question > option
951. Select all correct statements about Object.prototype
952. How do you create a Date object in JavaScript?
953. Which is used in JavaScript to insert special characters?
954. Which Popup Boxes have support in JavaScript?
955. Evaluate the following expression: ~-(2 + '2')
956. Which represents when a String object splits a String object into an array of strings by separating the string into substrings?
957. Which types of image maps can be used with JavaScript?
958. What's the output? var xyz = true; if (xyz) { let res = 42; } console.log(res);
959. Cookies are a plain text data record with the following variable-length fields?
960. Which code is correct for validating date values?
961. What is true about an Array?
962. How can you create a function with the JavaScript Function constructor ?
963. For the following html element, which is the correct method to change the font size to 25px using javascript? < p id = 'foo'>Lorem Ipsum
964. What happens if this code is executed? 'use strict'; foo = true;
965. A form contains two fields named idl and id2. How can you copy the value of the id2 field to idl?
966. Which function determines whether the beginning of the paraml instance matches the param2?
967. What method can't be used with a window object?
968. What's the output? (function() { var objl = new Object({name: 'Jacob'}); var obj2 = new Object({name: 'Alex'}); console.log(objl == obj2); console.log(objl === obj2);
969. The following are sample codes on how to merge properties of two JavaScript objects dynamically: var objl = { food: var obj2 = { animal: 'dog' }
970. Which will change the color of a paragraph’s text to blue when a user hovers over it, and reset it back to black when the user hovers out?
971. Which code will create the Boolean object with an initial value of true?
972. What's the output? var odnum = false; function calculateRes(num) { if (num % 5 == 0) { odnum = false; } else { odnum = true; } }; calculateRes(6);
973. What will be logged in the console? console.log(String.raw'Hello\nWorld!')
974. What is the super function in the class context?
975. Which are true about numbers in JavaScript?
976. What will the following code snippet log in the console? let arr = [1, 2, 3]; for (i = 0; i < arr.length; arr[i++] = 0) ; console.log(arr);
977. Select statements that will return true. Object is defined: let a = {a:1};
978. What will be logged to the console? console.log([0,0,0].fill(1,1) RangeError SyntaxError EvalError
979. Which statement returns false. First line in file is: var a = true; b = false; This code will throw an error delete a === b
980. Select the statement that will return truthy value. Array let a = [1,2,3,4] is defined
981. How can you remove spaces, tabs and line terminator characters around the string? String is defined like this: let string = 'hey'
982. The Promise is created. When will it resolve?
983. How can you set DOM element style assuming there is an element with id='id'?
984. Which will return true?
985. Arrow function expression has a shorter syntax than a function expression and does not bind its own as follow?
986. What's the output? var book; (function () { var title = 'Azom Kack'; book = { getAuthor: function () { return author; } }; }());
987. What command skips the rest of a case statement?
988. Correct way to write a JavaScript array?
989. What's printed on the browser console by following code:- console.log(parseFloat('9. Hello World '));
990. Which determines the type of a given object?
991. Which of the following is true? var a = [var b = a var c = a.slice() a.push('date')
992. Javascript JSON data manipulation- How can you access first, last name properties in data object using the following snippet? var data={'users':[ {'firstName':'Ali', 'lastName':'Rehman', 'birthday': { 'month':'January', 'day':20, 'year':1983 } } ]}
993. Which are structural patterns?
994. How you can check Left mouse button click property? document.addEventListener('mousedown', buttonpropertys, false);
995. Which represents when an Array object returns a string representing the array and its elements?
996. How do you locate the first X in a string variable named txt?
997. What value is returned when a Confirm box is cancelled?
998. What does the following line of code do?
999. Which statement is True for Behavioral design patterns?
1000. Correct way to create an Object
1001. A closure is a function defined inside another and has access to the variable which is declared and defined in parent function scope?
1002. What's the output? var foo = 10; bar = 3; (function() { var foo = 2; bar= 1; }()) bar = bar + foo; alert(bar);
1003. Structural design patterns patterns look at optimized or more controlled mechanisms of object creation
1004. Correct JavaScript syntax to change the content of next HTML element? This is a sample text.
1005. What's the output? function checkFun() { console.log(res); let res = 5000; }
1006. What options are types of declarations in JavaScript?
1007. What is the value of 'n1' and 'n2' after executing the following code? var str = 'Finding foo in Foo and Bar'; var nl = str.search('Foo'); var n2 = str.search(/Foo/i);
1008. The second control statement in a for loop usually:
1009. Which is true for Creational design patterns?
1010. Which file will be displayed if a computer has all required codecs?
1011. A ________ is a reusable block of javascript statements.
1012. A set of statements contained within a set of braces is known as a(n) ____ block.
1013. An infinite loop is an example of a(n) ____ error.
1014. Each piece of data contained in an array is called a(n) ____.
1015. For javascript external files the mime type is ____
1016. In order to make a window the active window, you use the ____ method of the window object.
1017. Objects are also called ____.
1018. Parseint is a method in the _______ class.
1019. Regular expression patterns consist of literal characters and ____.
1020. The static method ________ of class string returns a formatted string.
1021. The switch statement case value can evaluate to all of the following except ____.
1022. The type attribute value for javascript is ____.
1023. To place a node in the left of a borderpane p, use ________.
1024. To register a source for an action event with a handler, use ________.
1025. To check if an option button is selected, you access the value of its ____ property.
1026. Writing values directly to the console is known as ____.
1027. You can use the compound ____ to combine two strings.
1028. You use a ____ statement within a try block to specify an error message.
1029. You use the ____ method of the string class to split a string into an indexed array.
1030. The ____ attribute is used for sharing cookies across multiple servers in the same domain.
1031. The ____ method constructs a text string from unicode character codes that are passed as arguments.
1032. The ____ method is used to cancel a settimeout() method before its code executes.
1033. The ____ method is used to clear a setinterval() method call.
1034. The ____ object allows you to change to a new web page from within javascript code.
1035. The ____ object contains methods and properties for working with regular expressions in javascript.
1036. The ____ object is used to obtain information about the current web browser.
1037. After you throw an error, you use a ____ statement to handle the error.
1038. Each repetition of a looping statement is called a(n) ____.
1039. The ____ function converts all of the letters in a string to capital letters.
1040. Methods that set values are called ____ methods.
1041. Javascript requires _____ programming knowledge and experience as java.
1042. A(n) ____ is a variable that is used within a function.
1043. A(n) ____ statement is used to end the execution of a switch statement.
1044. Function statements are contained within the function ____.
1045. The ____ method is used in javascript to execute code after a specific amount of time has elapsed.
1046. The ____ operator executes one of two expressions based on the results of a conditional expression.
1047. To convert a javascript object to a json string, you use the ____ method.
1048. Use the ________ method to write text to a web page.
1049. If the expression is false, the ________ operator will return true.
1050. The ________ operator is a unary operator, as it works with only one operand.
1051. Less than (<), greater than (>), and not (not equal to) are examples of ____.
1052. A function includes its ____, which are values used by the function.
1053. In the bubble sort algorithm, the two arguments sent into the swap module are ________.
1054. Many programming languages include a string operation called __________.
1055. To manipulate arrays in your scripts, you use the methods and length property of the ____ class.
1056. Value is a function of ___________ and ___________?
1057. A(n) ____ is an object that has been created from an existing class.
1058. The ____ metacharacter is used to allow a string to contain an alternate set of substrings.
1059. The ____ method repeatedly executes the same code after being called only once.
1060. You can break up a long statement into multiple lines as long as you don't break up a ________.
1061. When javascript displays a numeric value, it stores that value to ____ digits of accuracy.
1062. The cookie property is created with a required ____ attribute.
1063. The _______ defines every object and element on a web page.
1064. Web pages are seen within a window called the _____.
1065. ________ is a standard for exchanging structured information over the web.
1066. Which operator returns true if the two compared values are not equal?
1067. How is a forEach statement different from a for statement?
1068. Which statement is the correct way to create a variable called rate and assign it the value 100?
1069. Which statement creates a new object using the Person constructor? Which statement creates a new Person object called "student"?
1070. How does a function create a closure?
1071. You need to match a time value such as 12:00:32. Which of the following regular expressions would work for your code?
1072. How would you reference the text 'avenue' in the code shown? Let roadTypes = ['street', 'road', 'avenue', 'circle'];
1073. What is the result of running this statement? Console.log(typeof 42);
1074. Which property references the DOM object that dispatched an event?
1075. Which method converts JSON data to a JavaScript object?
1076. When would you use a conditional statement?
1077. Which Object method returns an iterable that can be used to iterate over the properties of an object?
1078. What is one difference between collections created with Map and collections created with Object?
1079. 0 && hi
1080. Which of the following operators can be used to do a short-circuit evaluation?
1081. Which statement sets the Person constructor as the parent of the Student constructor in the prototype chain?
1082. Why would you include a "use strict" statement in a JavaScript file?
1083. Which Variable-defining keyword allows its variable to be accessed (as undefined) before the line that defines it?
1084. Which of the following values is not a Boolean false?
1085. Which of the following is not a keyword in JavaScript?
1086. Which variable is an implicit parameter for every function in JavaScript?
1087. Why is it usually better to work with Objects instead of Arrays to store a collection of records?
1088. Which statement is true about the "async" attribute for the HTML script tag?
1089. How do you import the lodash library making it top-level Api available as the "_" variable?
1090. What does the following expression evaluate to? [] == [];
1091. What type of function can have its execution suspended and then resumed at a later point?
1092. Which statement is true about Functional Programming?
1093. Your code is producing the error: TypeError: Cannot read property 'reduce' of undefined. What does that mean?
1094. How many prototype objects are in the chain for the following array? let arr = [];
1095. Which choice is not a unary operator?
1096. What will the value of y be in this code: const x = 6 % 2; const y = x ? 'One' : 'Two';
1097. Which keyword is used to create an error?
1098. What's one difference between the async and defer attributes of the HTML script tag?
1099. The following program has a problem. What is it? var a; var b = (a = 3) ? true : false;
1100. Which statement references the DOM node created by the code shown?
lorem ipsum
1101. Which collection object allows unique value to be inserted only once?
1102. How does the forEach() method differ from a for statement?
1103. Which choice is an incorrect way to define an arrow function that returns an empty object?
1104. Why might you choose to make your code asynchronous?
1105. Which expression evaluates to true?
1106. Which of these is a valid variable name?
1107. Which method cancels event default behavior?
1108. Which method do you use to attach one DOM node to another?
1109. Which statement is used to skip iteration of the loop?
1110. Which choice is valid example for an arrow function?
1111. Which concept is defined as a template that can be used to generate different objects that share some shape and/or behavior?
1112. How do you add a comment to JavaScript code?
1113. If you attempt to call a value as a function but the value is not a function, what kind of error would you get?
1114. Which method is called automatically when an object is initialized?
1115. What is the result of running the statement shown?
1116. Which statement represents the starting code converted to an IIFE?
1117. Which statement selects all img elements in the DOM tree?
1118. Why would you choose an asynchronous structure for your code?
1119. What is the HTTP verb to request the contents of an existing resource?
1120. Which event is fired on a text field within a form when a user tabs to it, or clicks or touches it?
1121. Which class-based lifecycle method would be called at the same time as this effect Hook? useEffect(() => { // do things }, []);
1122. What is the output of this code? var obj; console.log(obj);
1123. How do you remove the property name from this object? const foo = { name: 'Albert', };
1124. What is the difference between the map() and the forEach() methods on the Array prototype?
1125. If your app receives data from a third-party API, which HTTP response header must the server specify to allow exceptions to the same-origin policy?
1126. What is the output of this code? let x = 6 + 3 + '3'; console.log(x);
1127. Which statement can take a single expression as input and then look through a number of choices until one that matches that value is found?
1128. Which choice is a valid example of an arrow function, assuming c is defined in the outer scope?
1129. Which statement correctly imports this code from some-file.js? //some-file.js Export const printMe = (str) => console.log(str);
1130. Which method call is chained to handle a successful response returned by fetch()?
1131. Which choice is not an array method?
1132. Which JavaScript loop ensures that at least a singular iteration will happen?
1133. What will be logged to the console? console.log(typeof 'blueberry');
1134. How can you attempt to access the property a.b on obj without throwing an error if a is undefined? let obj = {};
1135. Given this code, which statement will evaluate to false? const a = { x: 1 }; const b = { x: 1 };
1136. What will this code log to the console?
1137. If nothing within a while loop ever causes the condition to become false, a(n) ________ may occur.
1138. In the google maps api, the ____ constructor creates a map object.
1139. When using the console.log() method to trace bugs, it can be helpful to use a ____ program.
1140. A pattern that matches the beginning or end of a line is called a(n) ____.
1141. A plug-in either opens in its own external window or runs within a web page as a(n) _____.
1142. A(n) ____ comment hides multiple lines of code.
1143. The ____ property of the location object contains a url?s query or search parameters.
1144. The ________ loads java bytecode to the memory.
1145. Through the use of the ____ plug-in, a webpage can provide a user with an interactive experience.
1146. ____ cookies remain available only for the current browser session.