772). What is the function of the XML parser?
[A]Converts XML document to XML DOM object
[B]Converts XML DOM object to XML document
[C]Converts XML DOM object to a comment
[D]Compiles the html document
Show Answer
Correct Answer: Converts XML document to XML DOM object
Notes:
Answer: a
Explanation: An XML parser converts an XML document into an XML DOM object – which can then be manipulated with JavaScript. All major browsers have a built-in XML parser to access and manipulate XML.
773). What is the purpose of the method ActiveXObject()?
[A]Used to call automation object
[B]Used to reference automation object
[C]Used to instantiate automation object
[D]Used to call & reference automation object
Show Answer
Correct Answer: Used to instantiate automation object
Notes:
Answer: c
Explanation: The ActiveXObject.prototype object allows adding properties and methods to the ActiveXObject object that can be used with instances of the ActiveXObject object like any predefined property or method. The ActiveXObject() object is used only to instantiate Automation objects, and has no members.
774). What is the purpose of the url json?
[A] Belongs to JSON object
[B]Reference JSON formatted data
[C]Belongs to JSON
[D]Compiles json data
Show Answer
Correct Answer: Reference JSON formatted data
Notes:
Answer: b
Explanation: The URL JSON is assumed to reference a file of JSON-formatted data. The value passed to the callback is the object obtained by parsing the URL contents with jQuery.parseJSON(). jQuery.getJSON() uses this type. If the type is “json” and the URL or data string contains “=?”, the type is converted to “jsonp”.
775). What is the parameter of the method Date.parse()?
[A]date
[B]string
[C]datestring
[D]string
Show Answer
Correct Answer: datestring
Notes:
Answer: c
Explanation: The parse method is defined as Date.parse(datestring). The parse() method parses a date string and returns the number of milliseconds between the date string.
776). Which is the function in JavaScript that will print the current page in JavaScript?
[A]print()
[B]printcurrent()
[C] print(now)
[D]print(this)
Show Answer
Correct Answer: print()
Notes:
Answer: a
Explanation: The print() method prints the contents of the current window. The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
777). To which of the following object does the print() method belong to?
[A]window
[B]document
[C]hash
[D]string
Show Answer
Correct Answer: window
Notes:
Answer: a
Explanation: The method print() belongs to the window object. The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
778). What will happen if the radix parameter of the parseInt() function is omitted?
[A] Runs in assumption
[B]Throws exception
[C]Aborts
[D]Taken as 0
Show Answer
Correct Answer: Runs in assumption
Notes:
Answer: a
Explanation: The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
If the string begins with “0x”, the radix is 16 (hexadecimal)
If the string begins with “0”, the radix is 8 (octal). This feature is deprecated
If the string begins with any other value, the radix is 10 (decimal)
779). What will be the radix value if the string begins with 0x?
Show Answer
Correct Answer: 16
Notes:
Answer: d
Explanation: If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal). If the string begins with any other value, the radix is 10 (decimal).
780). What is the function of the parseInt() method?
[A]Parses a data type and stores in an integer
[B] Parses a string and returns an integer
[C]Parses an integer and returns a string
[D]Parses a string and return an object
Show Answer
Correct Answer: Parses a string and returns an integer
Notes:
Answer: b
Explanation: The function parseInt() method parses a string and returns an integer. If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal).
781). What does it indicate when the radix value is 16?
[A]String begins with 0x
[B]String begins with 0
[C]String begins with 0P
[D]String begins with FF
Show Answer
Correct Answer: String begins with 0x
Notes:
Answer: a
Explanation: If the string begins with “0x”, the radix is 16 (hexadecimal). If the string begins with “0”, the radix is 8 (octal).
782). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 3
Notes:
Answer: c
Explanation: The \B metacharacter is used to find a match, but where it is NOT at the beginning/end of a word. It is found in the regex library.
783). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 11
Notes:
Answer: d
Explanation: The \0 metacharacter is used to find NUL character. \0 returns the position where the NUL character was found. If no match is found, it returns -1.
784). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 5
Notes:
Answer: b
Explanation: The \f metacharacter is used to find a form feed character. \f returns the position where the form feed character was found. If no match is found, it returns -1.
785). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 6
Notes:
Answer: a
Explanation: The \r metacharacter is used to find a carriage return character. \r returns the position where the carriage return character was found. If no match is found, it returns -1.
786). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 9
Notes:
Answer: c
Explanation: The \t metacharacter is used to find a tab character. \t returns the position where the tab character was found. If no match is found, it returns -1.
787). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 3
Notes:
Answer: c
Explanation: The \B metacharacter is used to find a match, but where it is NOT at the beginning/end of a word. It is found in the regex library.
788). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 11
Notes:
Answer: d
Explanation: The \0 metacharacter is used to find NUL character. \0 returns the position where the NUL character was found. If no match is found, it returns -1.
789). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 5
Notes:
Answer: b
Explanation: The \f metacharacter is used to find a form feed character. \f returns the position where the form feed character was found. If no match is found, it returns -1.
790). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 6
Notes:
Answer: a
Explanation: The \r metacharacter is used to find a carriage return character. \r returns the position where the carriage return character was found. If no match is found, it returns -1.
791). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 9
Notes:
Answer: c
Explanation: The \t metacharacter is used to find a tab character. \t returns the position where the tab character was found. If no match is found, it returns -1.