- 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 I
Q 1 - Which of the following is correct about JavaScript?
A - JavaScript is a lightweight, interpreted programming language.
Answer : D
Explanation
All of the above options are correct.
Q 2 - Which of the following is correct about features of JavaScript?
A - JavaScript is a lightweight, interpreted programming language.
B - JavaScript is designed for creating network-centric applications.
C - JavaScript is complementary to and integrated with Java.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following is correct about features of JavaScript?
A - JavaScript is is complementary to and integrated with HTML.
Answer : C
Explanation
Both of the above options are correct.
Q 4 - Which of the following is an advantage of using JavaScript?
Answer : D
Explanation
All of the above options are correct.
Q 5 - Which of the following is a disadvantage of using JavaScript?
A - Client-side JavaScript does not allow the reading or writing of files.
C - JavaScript doesn't have any multithreading or multiprocess capabilities.
Answer : D
Explanation
All of the above options are correct.
Answer : A
Explanation
Yes! JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.
Q 7 - Which of the following is true about variable naming conventions in JavaScript?
A - You should not use any of the JavaScript reserved keyword as variable name.
B - JavaScript variable names should not start with a numeral (0-9).
Answer : C
Explanation
Both of the above options are correct.
Q 8 - Which of the following is true about variable naming conventions in JavaScript?
A - JavaScript variable names must begin with a letter or the underscore character.
Answer : C
Explanation
Both of the above options are correct.
Q 9 - Which of the following is true about typeof operator in JavaScript?
B - Its value is a string indicating the data type of the operand.
Answer : C
Explanation
Both of the above options are correct.
Answer : A
Explanation
Yes! JavaScript can also manipulate cookies using the cookie property of the Document object.
Q 11 - Which of the following is true about cookie handling in JavaScript?
A - JavaScript can manipulate cookies using the cookie property of the Document object.
Answer : C
Explanation
Both of the above options are correct.
Q 12 - Which of the following is the correct syntax to create a cookie using JavaScript?
A - document.cookie = 'key1 = value1; key2 = value2; expires = date';
B - browser.cookie = 'key1 = value1; key2 = value2; expires = date';
C - window.cookie = 'key1 = value1; key2 = value2; expires = date';
D - navigator.cookie = 'key1 = value1; key2 = value2; expires = date';
Answer : A
Explanation
document.cookie = 'key1 = value1; key2 = value2; expires = date'; is the correct option.
Q 13 - Which of the following is the correct syntax to redirect a url using JavaScript?
A - document.location='http://www.newlocation.com';
B - browser.location='http://www.newlocation.com';
Answer : D
Explanation
window.location='http://www.newlocation.com'; is the correct option.
Q 14 - Which of the following is the correct syntax to print a page using JavaScript?
Answer : A
Explanation
window.print(); is the correct option.
Q 15 - Which of the following is a valid type of function javascript supports?
Answer : C
Explanation
A function in JavaScript can be either named or anonymous.
Answer : A
Explanation
Yes! An anonymous function can be assigned to a variable.
Answer : A
Explanation
Yes! An anonymous function can be passed as an argument to another function.
Q 18 - How can you get the type of arguments passed to a function?
Answer : A
Explanation
Using typeof operator, we can get the type of arguments passed to a function.
Q 19 - How can you get the total number of arguments passed to a function?
A - Using args.length property
Answer : B
Explanation
Using arguments.length property, we can get the total number of arguments passed to a function.
Q 20 - Which of the following type of variable is visible everywhere in your JavaScript code?
Answer : A
Explanation
Global Variables: A global variable has global scope which means it is visible everywhere in your JavaScript code.
Q 21 - Which of the following type of variable is visible only within a function where it is defined?
Answer : B
Explanation
Local Variables: A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.
Q 22 - Which of the following type of variable takes precedence over other if names are same?
Answer : B
Explanation
A local variable takes precedence over a global variable with the same name.
Q 23 - Which of the following is correct about callbacks?
A - A callback is a plain JavaScript function passed to some method as an argument or option.
Answer : C
Explanation
A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered.
Q 24 - Which built-in method returns the character at the specified index?
Answer : C
Explanation
charAt() method returns the character at the specified index.
Q 25 - Which built-in method combines the text of two strings and returns a new string?
Answer : B
Explanation
concat() method returns the character at the specified index.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | D |
3 | C |
4 | D |
5 | D |
6 | A |
7 | C |
8 | C |
9 | C |
10 | A |
11 | C |
12 | A |
13 | D |
14 | A |
15 | C |
16 | A |
17 | A |
18 | A |
19 | B |
20 | A |
21 | B |
22 | B |
23 | C |
24 | C |
25 | B |