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.
Q 1 - Which built-in method calls a function for each element in the array?
forEach() method calls a function for each element in the array.
Q 2 - Which built-in method returns the index within the calling String object of the first occurrence of the specified value?
indexOf() method returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.
Q 3 - Which built-in method returns the length of the string?
length() method returns the length of the string.
Q 4 - Which built-in method removes the last element from an array and returns that element?
pop() method removes the last element from an array and returns that element.
Q 5 - Which built-in method adds one or more elements to the end of an array and returns the new length of the array?
push() method adds one or more elements to the end of an array and returns the new length of the array.
Q 6 - Which built-in method reverses the order of the elements of an array?
reverse() method reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first.
Q 7 - Which built-in method sorts the elements of an array?
sort() method sorts the elements of an array.
Q 8 - Which built-in method returns the characters in a string beginning at the specified location?
substr() method returns the characters in a string beginning at the specified location through the specified number of characters.
Q 9 - Which built-in method returns the calling string value converted to lower case?
toLowerCase() method returns the calling string value converted to lower case.
Q 10 - Which built-in method returns the calling string value converted to upper case?
toUpperCase() method returns the calling string value converted to upper case.
Q 11 - Which built-in method returns the string representation of the number's value?
toString() method returns the string representation of the number's value.
Q 12 - All user-defined objects and built-in objects are descendants of an object called Object?
All user-defined objects and built-in objects are descendants of an object called Object.
Q 13 - Which of the following code creates an object?
var book = new Object(); creates an object.
Q 14 - Which of the following function of Number object forces a number to display in exponential notation?
toExponential(): Forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation.
Q 15 - Which of the following function of Number object formats a number with a specific number of digits to the right of the decimal?
toFixed() − Formats a number with a specific number of digits to the right of the decimal.
Q 16 - Which of the following function of Number object returns a string value version of the current number in a format that may vary according to a browser's locale settings.?
toLocaleString() − Returns a string value version of the current number in a format that may vary according to a browser's locale settings.
Q 17 - Which of the following function of Number object defines how many total digits to display of a number?
toPrecision() − Defines how many total digits (including digits to the left and right of the decimal) to display of a number.
Q 18 - Which of the following function of Number object returns a string value version of the current number?
toString() − Returns a string value version of the current number.
Q 19 - Which of the following function of Number object returns the number's value?
valueOf() − Returns the number's value.
Q 20 - Which of the following function of Boolean object returns a string containing the source of the Boolean object?
toSource() − Returns a string containing the source of the Boolean object; you can use this string to create an equivalent object.
Q 21 - Which of the following function of Boolean object returns the primitive value of the Boolean object?
valueOf() − Returns the primitive value of the Boolean object.
Q 22 - Which of the following function of Boolean object returns a string of either 'true' or 'false' depending upon the value of the object?
toString() − Returns a string of either 'true' or 'false' depending upon the value of the object.
Q 23 - Which of the following function of String object returns the character at the specified index?
charAt() − Returns the character at the specified index.
Q 24 - Which of the following function of String object returns a number indicating the Unicode value of the character at the given index?
charCodeAt() − Returns a number indicating the Unicode value of the character at the given index.
Q 25 - Which of the following function of String object combines the text of two strings and returns a new string?
concat() − Combines the text of two strings and returns a new string.
Question Number | Answer Key |
---|---|
1 | C |
2 | C |
3 | A |
4 | C |
5 | C |
6 | B |
7 | C |
8 | A |
9 | A |
10 | A |
11 | C |
12 | A |
13 | B |
14 | A |
15 | B |
16 | C |
17 | D |
18 | A |
19 | B |
20 | A |
21 | B |
22 | C |
23 | A |
24 | B |
25 | C |