Instruction
- Total number of questions : 10.
- Time alloted : 10 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
What is the lifetime of the data stored through localStorage? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Data stored through localStorage is permanent: it does not expire and remains stored on the user’s computer until a web app deletes it or the user asks the browser (through some browser-specific UI) to delete it. |
2. |
What will be done if more than one page requires a file of JavaScript code? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: If a file of JavaScript code is shared by more than one page, it only needs to be downloaded once, by the first page that uses it—subsequent pages can retrieve it from the browser cache. |
3. |
When will the window property come into play? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The Window object has a property named window that always refers to itself. You can use this property if you need to refer to the window object itself, but it is not usually necessary to use window if you just want to refer to access properties of the global window object. |
4. |
What is the code snippet to change the class and let the stylesheet specify the details? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The above code snippet changes the class and lets the stylesheet specify the details. |
5. |
Which of the following framework was used by Google for Gmail? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The Closure library is the client-side library that Google uses for Gmail, Google Docs, and other web applications. This library is intended to be used with the Closure compiler, which strips out unused library functions. |
6. |
What will happen if we call setTimeout() with a time of 0 ms? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: If you call setTimeout() with a time of 0 ms, the function you specify is not invoked right away. Instead, it is placed on a queue to be invoked “as soon as possible” after any currently pending event handlers finish running. |
7. |
Why is the replace() method better than the assign() method? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The replace() method is similar, but it removes the current document from the browsing history before loading the new document. When a script unconditionally loads a new document, the replace() method is often a better choice than assign(). |
8. |
Which is the preferred testing nowadays for scripting? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: In the past, the Navigator object was commonly used by scripts to determine if they were running in Internet Explorer or Netscape. This “browser-sniffing” approach is problematic because it requires constant tweaking as new browsers and new versions of existing browsers are introduced. Today, feature testing is preferred: rather than making assumptions about particular browser versions and their features, you simply test for the feature (i.e., the method or property) you need. |
9. |
Which is the property of a Window object that holids the name of the frame? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The name property of a Window object holds the name of the frame, if it has one. This property is writable, and scripts can set it as desired. |