
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.

Javascript Mock Test II
Q 1 - Which built-in method calls a function for each element in the array?
Answer : C
Explanation
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?
Answer : C
Explanation
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?
Answer : A
Explanation
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?
Answer : C
Explanation
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?
Answer : C
Explanation
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?
Answer : B
Explanation
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?
Answer : C
Explanation
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?
Answer : A
Explanation
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?
Answer : A
Explanation
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?
Answer : A
Explanation
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?
Answer : C
Explanation
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?
Answer : A
Explanation
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?
Answer : B
Explanation
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?
Answer : A
Explanation
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?
Answer : B
Explanation
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.?
Answer : C
Explanation
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?
Answer : D
Explanation
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?
Answer : A
Explanation
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?
Answer : B
Explanation
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?
Answer : A
Explanation
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?
Answer : B
Explanation
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?
Answer : C
Explanation
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?
Answer : A
Explanation
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?
Answer : B
Explanation
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?
Answer : C
Explanation
concat() − Combines the text of two strings and returns a new string.
Answer Sheet
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 |