• JavaScript Video Tutorials

Javascript Mock Test



This section presents you various set of Mock Tests related to Javascript Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

Javascript Mock Test IV

Q 1 - Which of the following function of String object causes a string to be displayed in a small font, as if it were in a <small> tag?

A - link()

B - small()

C - sup()

D - sub()

Answer : B

Explanation

small() − Causes a string to be displayed in a small font, as if it were in a <small> tag.

Q 2 - Which of the following function of String object causes a string to be displayed as struck-out text, as if it were in a <strike> tag?

A - sup()

B - small()

C - strike()

D - sub()

Answer : C

Explanation

strike() − Causes a string to be displayed as struck-out text, as if it were in a <strike> tag.

Q 3 - Which of the following function of String object causes a string to be displayed as a subscript, as if it were in a <sub> tag?

A - sup()

B - small()

C - strike()

D - sub()

Answer : D

Explanation

sub() − Causes a string to be displayed as a subscript, as if it were in a <sub> tag.

Q 4 - Which of the following function of String object causes a string to be displayed as a superscript, as if it were in a <sup> tag?

A - sup()

B - small()

C - strike()

D - sub()

Answer : A

Explanation

sup() − Causes a string to be displayed as a superscript, as if it were in a <sup> tag.

Q 5 - Which of the following function of Array object returns a new array comprised of this array joined with other array(s) and/or value(s)?

A - concat()

B - pop()

C - push()

D - some()

Answer : A

Explanation

concat() − Returns a new array comprised of this array joined with other array(s) and/or value(s).

Q 6 - Which of the following function of Array object returns true if every element in this array satisfies the provided testing function?

A - concat()

B - every()

C - push()

D - some()

Answer : B

Explanation

every() − Returns true if every element in this array satisfies the provided testing function.

Q 7 - Which of the following function of Array object creates a new array with all of the elements of this array for which the provided filtering function returns true?

A - concat()

B - every()

C - filter()

D - some()

Answer : C

Explanation

filter() − Creates a new array with all of the elements of this array for which the provided filtering function returns true.

Q 8 - Which of the following function of Array object calls a function for each element in the array?

A - concat()

B - every()

C - filter()

D - forEach()

Answer : D

Explanation

forEach() − Calls a function for each element in the array.

Q 9 - Which of the following function of Array object returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found?

A - indexOf()

B - join()

C - lastIndexOf()

D - map()

Answer : A

Explanation

indexOf() − Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found.

Q 10 - Which of the following function of Array object joins all elements of an array into a string?

A - concat()

B - join()

C - pop()

D - map()

Answer : B

Explanation

join() − Joins all elements of an array into a string.

Q 11 - Which of the following function of Array object returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found?

A - indexOf()

B - join()

C - lastIndexOf()

D - map()

Answer : C

Explanation

lastIndexOf() − Returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found.

Q 12 - Which of the following function of Array object creates a new array with the results of calling a provided function on every element in this array?

A - push()

B - join()

C - pop()

D - map()

Answer : D

Explanation

map() − Creates a new array with the results of calling a provided function on every element in this array.

Q 13 - Which of the following function of Array object removes the last element from an array and returns that element?

A - pop()

B - push()

C - join()

D - map()

Answer : A

Explanation

pop() − Removes the last element from an array and returns that element.

Q 14 - Which of the following function of Array object adds one or more elements to the end of an array and returns the new length of the array?

A - pop()

B - push()

C - join()

D - map()

Answer : B

Explanation

push() − Adds one or more elements to the end of an array and returns the new length of the array.

Q 15 - Which of the following function of Array object applies a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value?

A - pop()

B - push()

C - reduce()

D - reduceRight()

Answer : C

Explanation

reduce() − Applies a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value.

Q 16 - Which of the following function of Array object applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value?

A - pop()

B - push()

C - reduce()

D - reduceRight()

Answer : D

Explanation

reduceRight() − Applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value.

Q 17 - Which of the following function of Array object reverses the order of the elements of an array?

A - reverse()

B - push()

C - reduce()

D - reduceRight()

Answer : A

Explanation

reverse() − Reverses the order of the elements of an array.

Q 18 - Which of the following function of Array object removes the first element from an array and returns that element?

A - reverse()

B - shift()

C - slice()

D - some()

Answer : B

Explanation

shift() − Removes the first element from an array and returns that element.

Q 19 - Which of the following function of Array object extracts a section of an array and returns a new array?

A - reverse()

B - shift()

C - slice()

D - some()

Answer : C

Explanation

slice() − Extracts a section of an array and returns a new array.

Q 20 - Which of the following function of Array object returns true if at least one element in this array satisfies the provided testing function?

A - reverse()

B - shift()

C - slice()

D - some()

Answer : D

Explanation

some() − Returns true if at least one element in this array satisfies the provided testing function.

Q 21 - Which of the following function of Array object represents the source code of an object?

A - toSource()

B - splice()

C - toString()

D - unshift()

Answer : A

Explanation

toSource() − Represents the source code of an object.

Q 22 - Which of the following function of Array object sorts the elements of an array?

A - toSource()

B - sort()

C - toString()

D - unshift()

Answer : B

Explanation

sort() − Sorts the elements of an array.

Q 23 - Which of the following function of Array object adds and/or removes elements from an array?

A - toSource()

B - sort()

C - splice()

D - unshift()

Answer : C

Explanation

splice() − Adds and/or removes elements from an array.

Q 24 - Which of the following function of Array object returns a string representing the array and its elements?

A - toSource()

B - sort()

C - splice()

D - toString()

Answer : D

Explanation

toString() − Returns a string representing the array and its elements.

Q 25 - Which of the following function of Array object adds one or more elements to the front of an array and returns the new length of the array?

A - unshift()

B - sort()

C - splice()

D - toString()

Answer : A

Explanation

unshift() − Adds one or more elements to the front of an array and returns the new length of the array.

Answer Sheet

Question Number Answer Key
1 B
2 C
3 D
4 A
5 A
6 B
7 C
8 D
9 A
10 B
11 C
12 D
13 A
14 B
15 C
16 D
17 A
18 B
19 C
20 D
21 A
22 B
23 C
24 D
25 A
javascript_questions_answers.htm
Advertisements