Question 1:
What are the two parts of JavaScript libraries?
A.
“script” tag and “body” tag
B.
External JavaScript and the “script” tag
C.
“html” tag and “body” tag
D.
None of the mentioned
Answer: _________
Question 2:
Which of the following is possible to be referenced in external JavaScript?
A.
cpp
B.
cs
C.
php
D.
all of the mentioned
Answer: _________
Question 3:
Which of the following attribute takes the source of the PHP file?
A.
img
B.
src
C.
source
D.
none of the mentioned
Answer: _________
Question 4:
What kind of path can the PHP file be?
A.
Absolute
B.
Relative
C.
Either Absolute or Relative
D.
Both Absolute and Relative
Answer: _________
Question 5:
Which of the following global variables is used to get parameters?
A.
$HTTP_GET_VAR[]
B.
$HTTP_GET_VARS()
C.
$HTTP_GET_VARS
D.
$HTTP_GET_VARS[]
Answer: _________
Question 6:
What is the purpose of the RegExp method test()?
A.
Tests for a match in its float parameter
B.
Tests for a match in its string parameter
C.
Tests for a match in its integer parameter
D.
None of the mentioned
Answer: _________
Question 7:
What is the purpose of the function parameter filetype?
A.
File type to be expected
B.
File type previously got
C.
File type that should not be got
D.
None of the mentioned
Answer: _________
Question 8:
Which of the following is the method used to add an element to the desired location?
A.
add.element()
B.
element.add()
C.
element.appendChild()
D.
none of the mentioned
Answer: _________
Question 9:
Which program code doesn’t need preprocessing before being run?
A.
Text
B.
Script
C.
Both Text and Script
D.
None of the mentioned
Answer: _________
Question 10:
Which of the following is the definition for debugging?
A.
Finding bugs
B.
Fixing bugs
C.
Both Finding & Fixing bugs
D.
None of the mentioned
Answer: _________
Question 11:
Where is the error icon shown in the Internet Explorer?
A.
Taskbar
B.
Status bar
C.
Both Taskbar and Status bar
D.
None of the above
Answer: _________
Question 12:
Where is the error icon option available?
A.
Tools
B.
Help
C.
File
D.
Edit
Answer: _________
Question 13:
Which of the following is the window that the Firefox sends the error messages to?
A.
Bug Window
B.
Error Issues
C.
Error Window
D.
Error Console
Answer: _________
Question 14:
What is the procedure to view the console in the Firefox?
A.
Tools->Error Console
B.
Tools->Error Window
C.
Help->Error Console
D.
None of the mentioned
Answer: _________
Question 15:
What is the other way of calling the Error Console in Firefox?
A.
Error Window
B.
JavaScript Console
C.
JavaScript Window
D.
None of the above
Answer: _________
Question 16:
What kind of error notifications are shown in the console window?
A.
Syntax error
B.
Runtime error
C.
Both Syntax error and Runtime error
D.
None of the mentioned
Answer: _________
Question 17:
How do we debug a script?
A.
Use of JavaScript Validator
B.
Use of JavaScript Debugger
C.
Use of JavaScript Validator & Debugger
D.
None of the mentioned
Answer: _________
Question 18:
What is the purpose of a JavaScript debugger?
A.
Correction of errors
B.
Placing script execution under control
C.
Correction of errors & Placing script execution under control
D.
None of the mentioned
Answer: _________
Question 19:
What is a framework?
A.
User time efficiency
B.
Author time efficiency
C.
Both User time and Author time efficiency
D.
None of the mentioned
Answer: _________
Question 20:
What is the significance of scripting?
A.
Convenient
B.
Dynamic
C.
Reachable
D.
All of the mentioned
Answer: _________
Question 21:
What is the purpose of XMLHttpRequest?
A.
Multiple loading
B.
Load content by loading new document
C.
Load content without loading new document
D.
None of the mentioned
Answer: _________
Question 22:
Which API makes the user’s current location available to browser-based application?
A.
Java API
B.
SDL API
C.
Object API
D.
Geolocation API
Answer: _________
Question 23:
Which of the following ensures additional interactivity mechanism?
A.
WAI ARIA
B.
Geolocation API
C.
Object API
D.
None of the mentioned
Answer: _________
Question 24:
What is the necessity to have API?
A.
Guide to performing activities
B.
Describe particular task
C.
Both performing activities and Describe particular task
D.
None of the mentioned
Answer: _________
Question 25:
What is the purpose of the event onAirEvent?
A.
Content is played
B.
Content is transfered
C.
Both Content is played and transfered
D.
None of the mentioned
Answer: _________
Question 26:
What is the purpose of the event disconnectionEvent?
A.
Player demands for disconnection
B.
Player disconnects from the channel
C.
There is no user interaction
D.
None of the mentioned
Answer: _________
Question 27:
When does one use the event ready?
A.
Before loading
B.
During loading
C.
After loading
D.
None of the mentioned
Answer: _________
Question 28:
When does one use the method startOverlays()?
A.
Edit ad request
B.
Delete ad request
C.
Create ad request
D.
None of the mentioned
Answer: _________
Question 29:
What is the reason for avoiding the attributes property in the HTML DOM?
A.
Found unncessary
B.
Attributes don’t have attributes
C.
Attributes have attributes
D.
None of the mentioned
Answer: _________
Question 30:
In how many modes can the closure compiler be run?
A.
1
B.
2
C.
3
D.
4
Answer: _________
Question 31:
What is the purpose of the simple mode?
A.
Removes whitespaces
B.
Does not remove white spaces
C.
Removes the unwanted words
D.
None of the mentioned
Answer: _________
Question 32:
What is a closure compiler UI?
A.
Run time application
B.
Web application
C.
Standalone application
D.
All of the mentioned
Answer: _________
Question 33:
What are the benefits of closure compiler?
A.
Efficiency
B.
Code checking
C.
Both Efficiency and Code checking
D.
None of the mentioned
Answer: _________
Question 34:
In what way is the closure compiler efficient?
A.
Increases the size of the JavaScript files
B.
Reduces the size of the JavaScript files
C.
Reduces the execution time
D.
Reduces the speed
Answer: _________
Question 35:
In which way can the closure compiler can be used?
A.
Open source
B.
Run time application
C.
Web application
D.
Only Open source and Web application
Answer: _________
Question 36:
What is the purpose of the advanced mode in the closure compiler?
A.
Renames variables
B.
Renames function
C.
Both Renames variables and function
D.
None of the mentioned
Answer: _________
Question 37:
Why is a closure template used?
A.
Statically updating in JavaScript
B.
To increase the efficiency and convenience
C.
Dynamically generating HTML in Java and JavaScript
D.
All of the mentioned
Answer: _________
Question 38:
In what way does the closure compiler help in checking the code?
A.
Warnings
B.
Suddenly aborts
C.
Rejects malicious inputs
D.
All of the mentioned
Answer: _________
Question 39:
What is the function of the closure compiler?
A.
Download faster
B.
Run faster
C.
Both Download faster and Run faster
D.
None of the mentioned
Answer: _________
Question 40:
What does the interpreter do when you reference variables in other scopes?
A.
Traverses the queue
B.
Traverses the stack
C.
Finds the bugs
D.
None of the mentioned
Answer: _________
Question 41:
The attribute location belongs to which element?
A.
document
B.
html
C.
image
D.
pre
Answer: _________
Question 42:
What will happen if you reference document.location from within an object?
A.
Traverses the queue
B.
Finds the bugs
C.
Traverses the stack
D.
None of the mentioned
Answer: _________
Question 43:
Why do we need to create locally scoped variables to hold value?
A.
To optimize the testing process
B.
To increase the speed
C.
To minimize memory usage
D.
To cache the reference document.location
Answer: _________
Question 44:
What is the next step after calling the startTimeLogging()?
A.
Interpret the code
B.
Compile the code
C.
Run the code
D.
None of the mentioned
Answer: _________
Question 45:
During the traversing through the stack, where does it go after it goes to the namespace?
A.
Window
B.
Function
C.
Document
D.
Location
Answer: _________
Question 46:
During the traversing through the stack, where does it go after it goes to the window?
A.
Namespace
B.
Function
C.
Document
D.
None of the mentioned
Answer: _________
Question 47:
During the traversing of the stack when you create a locally scoped variable, where does it go after it goes to the namespace?
A.
Window
B.
Function
C.
Document
D.
Location
Answer: _________
Question 48:
What is the function used to stop capturing the ad hoc timing ?
A.
stopadhoc()
B.
stopTimer()
C.
stopTimeLogging()
D.
none of the mentioned
Answer: _________
Question 49:
During the traversing of the stack when you create a locally scoped variable, where does it go after it goes to the location?
A.
Window
B.
Function
C.
Document
D.
None of the mentioned
Answer: _________
Question 50:
What is the purpose of the Math method toSource()?
A.
Returns the string “Math”
B.
Sends the source to the Math Library
C.
Returns the value of the object
D.
None of the mentioned
Answer: _________
Question 51:
How many static methods does a Date object have?
A.
3
B.
5
C.
4
D.
2
Answer: _________
Question 52:
Which of the following are static methods in JavaScript?
A.
Date.parse()
B.
Date.UTC()
C.
Both Date.parse() and Date.UTC()
D.
None of the mentioned
Answer: _________
Question 53:
If we have an object r and want to know if it is a Range object, we can write:
A.
r typeof Range
B.
r is Range
C.
r equals Range
D.
r instanceof Range
Answer: _________
Question 54:
What is the property to access the first child of a node?
A.
timestamp.Child1
B.
timestamp.Child(1)
C.
timestamp.Child(0)
D.
timestamp.firstChild
Answer: _________
Question 55:
Which of the following is not an object?
A.
Element
B.
Location
C.
Position
D.
Window
Answer: _________
Question 56:
What is the purpose of the method nodeMap.setNamedItem()?
A.
Sets ID
B.
Sets attribute node
C.
Sets element name
D.
None of the mentioned
Answer: _________
Question 57:
How is everything treated in HTML DOM?
A.
Node
B.
Attributes
C.
Elements
D.
All of the mentioned
Answer: _________
Question 58:
What does the NamedNodeMap object represent in the HTML DOM?
A.
Unordered collection of elements
B.
Unordered collection of attributes
C.
Unordered collection of nodes
D.
All of the mentioned
Answer: _________
Question 59:
What is the purpose of the Attr object in the HTML DOM?
A.
Used to focus on a particular part of the HTML page
B.
HTML Attribute
C.
Used to arrange elements
D.
None of the mentioned
Answer: _________
Question 60:
What is the work of the form control elements in the HTML DOM?
A.
User Interface elements
B.
All the possible elements
C.
Debugging elements
D.
None of the mentioned
Answer: _________
Question 61:
How are the objects organized in the HTML DOM?
A.
Class-wise
B.
Queue
C.
Hierarchy
D.
None of the mentioned
Answer: _________
Question 62:
Which of the following is a type of HTML DOM?
A.
Legacy DOM
B.
W3C DOM
C.
IE4 DOM
D.
All of the mentioned
Answer: _________
Question 63:
What is the purpose of the Legacy DOM ?
A.
Makes the scripting easier
B.
Allows access to few keys and elements
C.
All of the mentioned
D.
None of the mentioned
Answer: _________
Question 64:
Which object is the top of the hierarchy?
A.
Window Object
B.
Document Object
C.
Form Object
D.
Form Control Elements
Answer: _________
Question 65:
In which part does the form validation occur?
A.
Client
B.
Server
C.
Both Client and Server
D.
None of the mentioned
Answer: _________
Question 66:
Which of the following is one of the fundamental features of JavaScript?
A.
Single-threaded
B.
Multi-threaded
C.
Both Single-threaded and
D.
None of the mentioned
Answer: _________
Question 67:
Which of the following functions are synchronous?
A.
load()
B.
require()
C.
both load() and require()
D.
none of the mentioned
Answer: _________
Question 68:
Why shouldn’t JavaScript functions not be too long?
A.
User friendliness
B.
Tie up event loops
C.
Browser becomes unresponsive
D.
All of the mentioned
Answer: _________
Question 69:
The object that looks to the thread that creates it is
A.
Window
B.
Worker
C.
Element
D.
Hash
Answer: _________
Question 70:
Which of the following is a global object for a new worker?
A.
WorkerGlobalScope
B.
Worker
C.
WorkerScope
D.
Window
Answer: _________
Question 71:
Which will be invoked to create a new worker?
A.
Function
B.
Destructor
C.
Constructor
D.
Interface
Answer: _________
Question 72:
What will happen if you specify an absolute URL in the Worker constructor?
A.
Resolves itself
B.
Must have the same origin
C.
Must not have the same origin
D.
None of the mentioned
Answer: _________
Question 73:
How can you send data using a Worker object?
A.
postMessage()
B.
sendMessage()
C.
Message()
D.
post()
Answer: _________
Question 74:
Which property is used to manage multiple event handlers?
A.
onmessage
B.
onerror
C.
both onmessage and onerror
D.
none of the mentioned
Answer: _________
Question 75:
Which is the function that allows a worker to terminate itself?
A.
close()
B.
exit()
C.
terminate()
D.
halt()
Answer: _________
Question 76:
Which is the function used to loop in an array to view all the values?
A.
all()
B.
loop()
C.
each()
D.
none of the mentioned
Answer: _________
Question 77:
Which of the following has a greater benchmark time for looping and JQuery vs core JavaScript in milliseconds?
A.
Chrome JQuery
B.
Chrome JavaScript
C.
Firefox JQuery
D.
Firefox JavaScript
Answer: _________
Question 78:
Which class provides an interface for invoking JavaScript methods and examining JavaScript properties?
A.
ScriptObject
B.
JSObject
C.
JavaObject
D.
Jobject
Answer: _________
Question 79:
What is the purpose of the function eval?
A.
Executes the string as an integer
B.
Gets the value of the string
C.
Executing string as JavaScript
D.
None of the mentioned
Answer: _________
Question 80:
Which of the following has a lesser benchmark time for using JQuery to access DOM versus pure JavaScript in milliseconds?
A.
Chrome JQueryDOM_
B.
Chrome JSDOM_benc
C.
Firefox JQueryDOM_
D.
Firefox JSDOM_benc
Answer: _________
Question 81:
Which is a wrapped Java array, accessed from within JavaScript code?
A.
JavaArray
B.
JavaClass
C.
JavaObject
D.
JavaPackage
Answer: _________
Question 82:
What is the syntax of close method for document object?
A.
Close(object)
B.
Close(doc)
C.
Close(val)
D.
Close()
Answer: _________
Question 83:
How do you find the number with the highest value of x and y?
A.
ceil(x,y)
B.
top(x,y)
C.
Math.ceil(x,y)
D.
Math.max(x,y)
Answer: _________
Question 84:
How can you find a client’s browser name?
A.
browser.name
B.
navigator.appName
C.
client.navName
D.
none of the mentioned
Answer: _________
Question 85:
Which of the following is not a JavaScript framework?
A.
Rico
B.
Prototype
C.
Joco
D.
DoJo
Answer: _________
Question 86:
What would happen if the data in the client had been wrong?
A.
Sends back the data
B.
Waits for correction
C.
Sends back the data and Waits for correction
D.
None of the mentioned
Answer: _________
Question 87:
What is the purpose of the basic validation?
A.
Data correctness
B.
Mere data existence
C.
Both Data correctness and Mere data existence
D.
None of the mentioned
Answer: _________
Question 88:
What is the purpose of data format validation?
A.
Data correctness
B.
Mere data existence
C.
Both Data correctness and Mere data existence
D.
None of the mentioned
Answer: _________
Question 89:
Which is the function that is called to validate a data?
A.
validate()
B.
valid()
C.
validation()
D.
none of the mentioned
Answer: _________
Question 90:
How to find the index of a particular string?
A.
position()
B.
index()
C.
indexOf()
D.
none of the mentioned
Answer: _________
Question 91:
How do you focus a particular part of the HTML page in JavaScript?
A.
hover()
B.
focus()
C.
on()
D.
all of the mentioned
Answer: _________
Question 92:
Which of the following is the child object of the JavaScript navigator?
A.
Navicat
B.
Plugins
C.
NetRight
D.
None of the mentioned
Answer: _________
Question 93:
Which of the following are the properties of a plug-in entry?
A.
name
B.
filename
C.
mimeTypes
D.
all of the mentioned
Answer: _________
Question 94:
What is the purpose of the mimeTypes property of a plug-in entry?
A.
Contains MIME properties
B.
Contains MIME sizes
C.
Contains MIME types
D.
None of the mentioned
Answer: _________
Question 95:
What is it called when we make a mistake in the script?
A.
Error
B.
Bug
C.
Mistake
D.
All of the mentioned
Answer: _________
Question 96:
Where are memory leaks found?
A.
Client side objects
B.
Server side objects
C.
Both Client side and Server side objects
D.
None of the mentioned
Answer: _________
Question 97:
Which handler is triggered when the content of the document in the window is stable and ready for manipulation?
A.
onload
B.
manipulate
C.
create
D.
none of the mentioned
Answer: _________
Question 98:
What is the central concept of JavaScript memory management?
A.
Reliability
B.
Reachability
C.
Efficiency
D.
Transparency
Answer: _________
Question 99:
When does a memory leak happen?
A.
Browser doesn’t release memory from objects unnecessary
B.
Browser releases too many memories
C.
All of the mentioned
D.
None of the mentioned
Answer: _________
Question 100:
The style property belongs to while of the following object?
A.
Element
B.
Window
C.
Location
D.
None of the mentioned
Answer: _________
Question 101:
Which of the following functions are referenced internally?
A.
setTimeout
B.
setInterval
C.
both setTimeout and setInterval
D.
none of the mentioned
Answer: _________
Question 102:
What is the purpose of destroying the functions and objects?
A.
Consume unnecessary CPU cycles
B.
Prevent the dropping of reference count to 0
C.
Centralize the responsibility to clean up
D.
All of the mentioned
Answer: _________
Question 103:
When does a cycle occur during memory leak?
A.
No reference occurs
B.
Two objects reference
C.
One object gets referenced
D.
None of the above
Answer: _________
Question 104:
Which of the following is a way to retain an object in memory?
A.
Console Log
B.
Closures
C.
Destory objects
D.
All of the mentioned
Answer: _________
Question 105:
In which format does JavaScript support external JavaScript?
A.
.js
B.
.php
C.
.js/php
D.
.jss
Answer: _________
Question 106:
BLOB stands for
A.
Binary Little Object
B.
Binary Large Object
C.
Broken Large Object
D.
None of the mentioned
Answer: _________
Question 107:
The size of blobs are generally calculated in
A.
Meters
B.
Kilometers
C.
Bytes
D.
Pixels
Answer: _________
Question 108:
The blobs are generally stored in
A.
Memory
B.
Disk
C.
Both Memory and Disk
D.
None of the mentioned
Answer: _________
Question 109:
The blobs are broken into smaller pieces using which of the following functions?
A.
partition()
B.
cut()
C.
sliceall()
D.
slice()
Answer: _________
Question 110:
Which algorithm supports blobs?
A.
Structured clone algorithm
B.
Double buffer algorithm
C.
Chen’s algorithm
D.
Retrieval algorithm
Answer: _________
Question 111:
Which database can be used to retrieve blobs?
A.
Server-side databases
B.
Client-side databases
C.
Both Server-side and Client-side databases
D.
None of the mentioned
Answer: _________
Question 112:
Which object can be used to create your own blobs?
A.
Creator
B.
BlobCreator
C.
BlobBuilder
D.
None of the mentioned
Answer: _________
Question 113:
Which of the following is a subtype of Blob?
A.
Elemental Object
B.
Create Object
C.
Data Object
D.
File Object
Answer: _________
Question 114:
Which method facilitates in uploading a Blob to a server?
A.
send()
B.
pass()
C.
upload()
D.
store()
Answer: _________
Question 115:
A Blob URL can be created using which of the following function?
A.
createURL()
B.
createObjectURL()
C.
designURL()
D.
URLCreation()
Answer: _________
Question 116:
What is the code snippet to change the class and let the stylesheet specify the details?
A.
timestamp.className = "highlight"
B.
timestamp.className = "change"
C.
timestamp.className = "specify"
D.
timestamp.className = "move"
Answer: _________
Question 117:
Which of the following is added to prefs.js when the console is automatically opened during JavaScript error?
A.
user_pref("javascript.console.open_on_error", true)
B.
user_pref("javascript.console.open_error ", true)
C.
user_pref("javascript.console.open_error ", false)
D.
user_pref(" javascript.console.open_on_error", false)
Answer: _________
Answer Key
1:
B
Solution: All JavaScript libraries consists of two parts: 1. The external JavaScript itself, which is simply a text file with the containing JavaScript code, saved as a .js file. 2. A “script” tag referencing the external JavaScript file and defined on the page(s) that uses the library.
2:
C
Solution: One of the lesser known sides of external JavaScript is the ability to reference a PHP file instead of the familiar .js file.
3:
B
Solution: The syntax to referencing a PHP file using external JavaScript is consistent enough with what we already know: < script type ="text/javascript" src ="myscript.php">
4:
C
Solution: The PHP file is either an absolute or relative path to a PHP script instead of the usual .js file.
5:
D
Solution: The global variable $HTTP_GET_VARS[] is used to get parameters.
6:
B
Solution: The RegExp method test() tests for a match in its string parameter.
7:
A
Solution: The function parameter “filetype” lets you tell the script what file type to expect before loading.
8:
C
Solution: The method element.appendChild() is used to add the element to the desired location within the document tree.
9:
B
Solution: A script is program code that doesn’t need pre-processing (e.g. compiling) before being run.
10:
C
Solution: The process of finding and fixing bugs is called debugging and is a normal part of the development process.
11:
B
Solution: The error icon is shown in the status bar of the Internet Explorer.
12:
A
Solution: The error icon option can be enabled in the Tools.
13:
D
Solution: The browsers like Firefox, Netscape and Mozilla send error messages to a special window called the JavaScript Console or Error Consol.
14:
A
Solution: To view the console, select Tools –> Error Consol or Web Development.
15:
B
Solution: The Error Console is also termed as the JavaScript Console.
16:
C
Solution: Error notifications that show up on Console or through Internet Explorer dialog boxes are the result of both syntax and runtime errors. These error notification include the line number at which the error occurred.
17:
C
Solution: Both the JavaScript Validator and the JavaScript Debugger can be used to debug a script.
18:
B
Solution: A debugger is an application that places all aspects of script execution under the control of the programmer. Debuggers provide fine-grained control over the state of the script through an interface that allows you to examine and set values as well as control the flow of execution.
19:
B
Solution: Frameworks are an author-time efficiency, meaning that they make coding tasks much simpler by abstracting the real work that goes into doing those tasks.
20:
B
Solution: Scripting makes Web pages more dynamic) For example, without reloading a new version of a page it may allow modifications to the content of that page, or allow content to be added to or sent from that page. The former has been called DHTML (Dynamic HTML), and the latter AJAX (Asynchronous JavaScript and XML).
21:
C
Solution: XMLHttpRequest makes it possible to load additional content from the Web without loading a new document, a core component of AJAX.
22:
D
Solution: The Geolocation API makes the user’s current location available to browser-based applications.
23:
A
Solution: WAI ARIA offers mechanisms to ensure that this additional interactivity remains usable independent of devices and disabilities.
24:
B
Solution: An API may describe the ways in which a particular task is performed.
25:
A
Solution: The event onAirEvent is fired when the player starts playing content being broadcasted on the channel.
26:
B
Solution: The event disconnectionEvent is fired when the player disconnects from the channel, whether a result of user interaction or not.
27:
C
Solution: The event ready is fired after the player is done loading. It is safe to interact with it after this event fired.
28:
C
Solution: A new ad request is made every time when the method startOverlays() gets called.
29:
B
Solution: The reason for avoiding the attributes property in the HTML DOM is because Attributes don’t have attributes.
30:
B
Solution: There are totally 2 modes in which the closure compiler can be run namely : 1. Simple mode 2. dvanced mode
31:
A
Solution: In Simple mode it mostly performs like most other minifiers, removing whitespace, line breaks, and comments.
32:
B
Solution: A closure compiler UI is a web application.
33:
D
Solution: The closure compiler is highly beneficial in terms of : 1. Efficiency: The Closure Compiler reduces the size of your JavaScript files and makes them more efficient, helping your application to load faster and reducing your bandwidth needs. 2. Code checking: The Closure Compiler provides warnings for illegal JavaScript and warnings for potentially dangerous operations, helping you to produce JavaScript that is less buggy and easier to maintain.
34:
B
Solution: The Closure Compiler reduces the size of your JavaScript files and makes them more efficient, helping your application to load faster and reducing your bandwidth needs.
35:
D
Solution: You can use the Closure Compiler as: 1. An open source Java application that you can run from the command line. 2. A simple web application. 3. A RESTful API.
36:
C
Solution: In Advanced mode it rewrites the JavaScript by renaming variables and functions from longer descriptive names to single letters to save file size, and it inlines functions, coalescing them into single functions wherever it determines that it can.
37:
C
Solution: Closure Templates are a templating system for dynamically generating HTML in both Java and JavaScript. Because the language was apparently referred to as “Soy” internal to Google, and “Soy” remains in some of the documentation and classes, sometimes Closure Templates are referred to as “Soy Templates”.
38:
A
Solution: The Closure Compiler provides warnings for illegal JavaScript and warnings for potentially dangerous operations, helping you to produce JavaScript that is less buggy and easier to maintain.
39:
C
Solution: The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what’s left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.
40:
B
Solution: Normally when you reference variables in other scopes— at the global level, in other namespaces, and so on—the interpreter needs to traverse the stack to get to the variable.
41:
A
Solution: The attribute location belongs to the document element.
42:
C
Solution: If you reference document.location from within an object, the interpreter will need to go from the function that references the variable, up out of the namespace to the global window scope, down to the document scope, and get the location value.
43:
D
Solution: The locally scoped variables are created to cache the reference to document.location.
44:
C
Solution: Once the startTimeLogging() method is called, run the code to test.
45:
A
Solution: During the traversal in the stack manner, after going to the namespace, it goes to the Window.
46:
D
Solution: During the traversal in the stack manner, after going to the window, it goes no where.
47:
B
Solution: When you create a locally scoped variable for caching the reference, the traversal reverses in the forward direction and thus, after going to the namespace, it goes to the function.
48:
C
Solution: In order to stop capturing the ad hoc timing for referencing uncached document.location, we call the method stopTimeLogging().
49:
D
Solution: When you create a locally scoped variable for caching the reference, the traversal reverses in the forward direction and thus, after going to the location, it goes no where.
50:
A
Solution: The method Math.toSource() returns the string “Math”. But this method does not work with many browsers like IE.
51:
D
Solution: The Date object defines two static methods namely Date.parse() and Date.UTC().
52:
C
Solution: Date.parse() parses a string representation of a date and time and returns the internal millisecond representation of that date. Date.UTC() Returns the millisecond representation of the specified UTC date and time.
53:
D
Solution: The r instanceof Range returns true if r inherits from Range.prototype. The instanceof operatory does not actually check whether r was initialized by the Range constructor.
54:
D
Solution: The first child of a node can be accessed using the firstChild property.
55:
C
Solution: There is no object called Position.
56:
B
Solution: The method nodeMap.setNamedItem() sets the specified attribute node (by name).
57:
A
Solution: In the HTML DOM (Document Object Model), everything is a node: 1. The document itself is a document node. 2. All HTML elements are element nodes. 3. All HTML attributes are attribute nodes. 4. Text inside HTML elements are text nodes. 5. Comments are comment nodes.
58:
D
Solution: In the HTML DOM, the NamedNodeMap object represents an unordered collection of an elements attribute nodes.
59:
B
Solution: In the HTML DOM, the Attr object represents an HTML attribute.
60:
A
Solution: Form control elements: The form object contains all the elements defined for that object such as text fields, buttons, radio buttons, and checkboxes.
61:
C
Solution: The objects are organized in the hierarchy format in the HTML DOM.
62:
D
Solution: All of the above mentioned are types of HTML DOM.
63:
B
Solution: The Legacy DOM: This is the model which was introduced in early versions of JavaScript language. It is well supported by all browsers, but allows access only to certain key portions of documents, such as forms, form elements, and images.
64:
A
Solution: Window object is the top of the hierarchy. It is the outmost element of the object hierarchy.
65:
B
Solution: Form validation used to occur at the server, after the client had entered all necessary data and then pressed the Submit button.
66:
A
Solution: One of the fundamental features of client-side JavaScript is that it is single-threaded: a browser will never run two event handlers at the same time, and it will never trigger a timer while an event handler is running, for example.
67:
C
Solution: JavaScript has two synchronous load() and require().
68:
D
Solution: The client-side JavaScript functions must not run too long: otherwise they will tie up the event loop and the web browser will become unresponsive to user input.
69:
B
Solution: The Worker object: this is what a worker looks like from the outside, to the thread that creates it.
70:
A
Solution: The WorkerGlobalScope is the global object for a new worker, and it is what a worker thread looks like, on the inside, to itself.
71:
C
Solution: To create a new worker, just use the Worker() constructor, passing a URL that specifies the JavaScript code that the worker is to run.
72:
B
Solution: If you specify an absolute URL, it must have the same origin (same protocol, host, and port) as that containing document.
73:
A
Solution: Once you have a Worker object, you can send data to it with postMessage(). The value you pass to postMessage() will be cloned, and the resulting copy will be delivered to the worker via a message event:
74:
C
Solution: You can use onmessage and onerror properties if you want to manage multiple event handlers.
75:
A
Solution: The close() function allows a worker to terminate itself, and it is similar in effect to the terminate() method of a Worker object.
76:
C
Solution: The method jQuery.each(array, function) loops through the array.
77:
A
Solution: When we try to compare the average benchmark time for looping and JQuery vs core JavaScript in milliseconds, the Chrome JQuery has a greater benchmark time.
78:
B
Solution: When a JavaScript object is passed or returned to Java code, it is wrapped in an instance of JSObject. When a JSObject instance is passed to the JavaScript engine, it is unwrapped back to its original JavaScript object. The JSObject class provides a way to invoke JavaScript methods and examine JavaScript properties.
79:
C
Solution: eval is a JavaScript native function that accepts a string and executes the string as JavaScript. It basically fires up the interpreter and allows the passed-in string to be parsed and interpreted at the time of invocation.
80:
D
Solution: When we try to compare the average benchmark time for using JQuery to access DOM versus pure JavaScript in milliseconds, the Firefox JSDOM_benc has a lesser benchmark time.
81:
A
Solution: JavaArray is accessed from within JavaScript code.
82:
D
Solution: In order to close a document object, we need to call Close().
83:
D
Solution: Math.max(x,y) is used to find the highest value of x and y.
84:
B
Solution: The client’s browser name can be found by using navigator.appName.
85:
D
Solution: Dojo Toolkit is an open source modular JavaScript library (or more specifically JavaScript toolkit) designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites.
86:
C
Solution: If some of the data that had been entered by the client had been in the wrong form or was simply missing, the server would have to send all the data back to the client and request that the form be resubmitted with correct information.
87:
B
Solution: First of all, the form must be checked to make sure data was entered into each form field that required it. This would need just loop through each field in the form and check for data.
88:
A
Solution: The data that is entered must be checked for correct form and value. This would need to put more logic to test correctness of data.
89:
D
Solution: There is no such function to validate a data) But, you can write a function with any name to validate the data.
90:
C
Solution: The indexOf() function can be used to find out the index of a particular character or a string.
91:
B
Solution: The focus() function can be used to focus a particular part of the HTML page in JavaScript.
92:
B
Solution: The JavaScript navigator object includes a child object called plugins.
93:
D
Solution: Each plug-in has an entry in the array. Each entry has the following properties: 1. name – is the name of the plug-in. 2. filename – is the executable file that was loaded to install the plug-in. 3. description – is a description of the plug-in, supplied by the developer. 4. mimeTypes – is an array with one entry for each MIME type supported by the plug-in.
94:
C
Solution: mimeTypes is an array with one entry for each MIME type supported by the plug-in.
95:
B
Solution: A mistake in a script is referred to as a bug.
96:
A
Solution: Memory leaks occur when we are developing client-side reusable scripting objects.
97:
A
Solution: One of the most important event handlers is the onload handler of the Window object. It is triggered when the content of the document displayed in the window is stable and ready to be manipulated) JavaScript code is commonly wrapped within an onload event handler.
98:
B
Solution: The central concept of JavaScript memory management is a concept of reachability. 1. A distinguished set of objects are assumed to be reachable: these are known as the roots. Typically, these include all the objects referenced from anywhere in the call stack (that is, all local variables and parameters in the functions currently being invoked), and any global variables. 2. Objects are kept in memory while they are accessible from roots through a reference or a chain of references.
99:
A
Solution: Memory leak happens when the browser for some reason doesn’t release memory from objects which are not needed any more.
100:
A
Solution: Each Element object has style and className properties that allow scripts to specify CSS styles for a document element or to alter the CSS class names that apply to the element.
101:
C
Solution: Functions used in setTimeout/setInterval are referenced internally and tracked until complete, then cleaned up.
102:
D
Solution: The primary purpose of a destroy function is to centralize the responsibility for cleaning up anything that the object has done that will: 1. Prevent its reference count from dropping to 0 (for example, removing problematic event listeners and callbacks and unregistering from any services). 2. Consume unnecessary CPU cycles, such as intervals or animations.
103:
B
Solution: A cycle happens when two objects reference each other in such a way that both objects retain each other.
104:
A
Solution: One particularly obscure way to retain an object in memory is to log it to the console.
105:
A
Solution: JavaScript supports external JavaScript, in the form of .js file.
106:
B
Solution: A Blob is an opaque reference to, or handle for, a chunk of data. The name comes from SQL databases, where it means “Binary Large Object.” In JavaScript, Blobs often represent binary data, and they can be large, but neither is required: a Blob could also represent the contents of a small text file.
107:
C
Solution: Blobs are opaque: all you can do with them directly is determine their size in bytes, ask for their MIME type, and chop them up into smaller Blobs.
108:
C
Solution: The web browser can store Blobs in memory or on disk, and Blobs can represent really enormous chunks of data (such as video files) that are too large to fit in main memory without first being broken into smaller pieces with slice().
109:
D
Solution: The web browser can store Blobs in memory or on disk, and Blobs can represent really enormous chunks of data (such as video files) that are too large to fit in main memory without first being broken into smaller pieces with slice().
110:
A
Solution: Blobs are supported by the structured clone algorithm, which means that you can obtain one from another window or thread via the message event.
111:
B
Solution: Blobs can be retrieved fro client-side databases.
112:
C
Solution: You can create your own blobs, using a BlobBuilder object to build them out of strings, ArrayBuffer objects, and other Blobs.
113:
D
Solution: The client-side JavaScript File object is a subtype of Blob: a File is just a Blob of data with a name and a modification date.
114:
A
Solution: You can upload a Blob to a server by passing it to the send() method of an XMLHttpRequest object.
115:
B
Solution: Create a Blob URL with the function createObjectURL(). At the time of this writing, the draft specification and Firefox 4 put this function in a global object named URL, and Chrome and Webkit prefix that new global, calling it webkitURL.
116:
A
Solution: The above code snippet changes the class and lets the stylesheet specify the details.
117:
A
Solution: is added to prefs.js when the console is automatically opened during JavaScript error.