802). How many default number methods are available in JavaScript?
Show Answer
Correct Answer: 7
Notes:
Answer: c
Explanation: There are a total of 7 default number methods in JavaScript namely:
constructor()
toExponential()
toFixed()
toLocaleString()
toPrecision()
toString()
valueOf()
803). What is the observer effect?
[A]Observing influences outcome
[B]Observing never influences outcome
[C]Observing and the outcome are independent
[D]Observing and the outcome are not related
Show Answer
Correct Answer: Observing influences outcome
Notes:
Answer: a
Explanation: The observer effect says that simply observing an act influences its outcome. This is often the result of instruments that, by necessity, alter the state of what they measure in some manner.
804). Which of the following are ways to benchmark code?
[A]Timing the code
[B]Calculating the number of operations performed
[C]Timing the code & Calculating the number of operations performed
[D]Calculating the number of lines
Show Answer
Correct Answer: Timing the code & Calculating the number of operations performed
Notes:
Answer: c
Explanation: There are a couple of ways to benchmark code—either by timing it or by calculating the number of operations performed during execution. Both of them help in calculating how efficient and modular the code.
805). How to calculate the run time of a code?
[A]Start time – End time
[B] End time – Start time
[C]Start time/ End time
[D]Start time * End time
Show Answer
Correct Answer: End time – Start time
Notes:
Answer: b
Explanation: Run-time statements use the static resources created by compile-time statements, but can also create, use, and destroy dynamic resources at run time. The run time of code can be calculated as:
run time = end time – start time
806). According to the workflow of a runtime logging, what happens after calculating the run time?
[A]Display to screen
[B] Log to server
[C]Either Display to screen or Log to server
[D]Server to log
Show Answer
Correct Answer: Either Display to screen or Log to server
Notes:
Answer: c
Explanation: According to the workflow of a runtime logging, after calculating the run time, decision boxes are kept that will check to either display to the debug screen or log to the server.
807). Which of the following object is used to post the data to an external process, say savePerfData?
[A]XML
[B]XBT
[C]XHR
[D]XTR
Show Answer
Correct Answer: XHR
Notes:
Answer: c
Explanation: XHR(XMLHttpRequest) is an API in the form of an object whose methods transfer data between a web browser and a web server. The benchmarking process will call the external process. We use XHR object to post the data to the external process.
808). Where does the external process save the result of the test?
[A]Normal file
[B]Flat file
[C]Folder
[D] .exe file
Show Answer
Correct Answer: Flat file
Notes:
Answer: b
Explanation: A flat file consists of a single table of data. It allows the user to specify data attributes, such as columns and data types table by table, and stores those attributes separate from applications. The external process, say savePerfData should in turn save the results of the test in a flat file.
809). Which function is used to start the time logging?
[A]startTimeLogging()
[B]start()
[C]Loggingstart()
[D]startLogging()
Show Answer
Correct Answer: startTimeLogging()
Notes:
Answer: a
Explanation: The function startTimeLogging() is used to start the time logging. The startTimeLogging() method captures the timing data for ad hoc, etc for referencing an uncached document.location.
810). Which of the following attribute of form tag is not set by using document object in JavaScript?
[A]Target
[B]Enctype
[C]Action
[D]Logging
Show Answer
Correct Answer: Logging
Notes:
Answer: d
Explanation: Target, enctype & action can be set by using the document object in JavaScript. The Document object has various properties that refer to other objects which allow access to and modification of document content.
811). What will be the output of the following JavaScript function?
[A]SanfoundryThe Best
[B]Sanfoundry The Best
[C] Object required error
[D]Javascript Error
Show Answer
Correct Answer: Sanfoundry The Best
Notes:
Answer: b
Explanation: The write() method writes HTML expressions or JavaScript code to a document.The write() method is mostly used for testing: If it is used after an HTML document is fully loaded, it will delete all existing HTML. The output for the above code is Sanfoundry The Best.