- 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 Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Javascript Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
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 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 3 - 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 4 - 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 5 - 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 6 - Which of the following function of String object returns the characters in a string between two indexes into the string?
Answer : D
Explanation
substring() − Returns the characters in a string between two indexes into the string.
Q 7 - Which of the following function of String object creates a string to be displayed as bold as if it were in a <b> tag?
Answer : D
Explanation
bold() − Creates a string to be displayed as bold as if it were in a <b> tag.
Q 8 - Which of the following function of String object causes a string to be displayed in fixed-pitch font as if it were in a <tt> tag?
Answer : A
Explanation
fixed() − Causes a string to be displayed in fixed-pitch font as if it were in a <tt> tag.
Q 9 - Which of the following function of Array object returns true if every element in this array satisfies the provided testing function?
Answer : B
Explanation
every() − Returns true if every element in this array satisfies the provided testing function.
Q 10 - Which of the following function of Array object sorts the elements of an array?
Answer : B
Explanation
sort() − Sorts the elements of an array.