JavaScript Questions & Answers – Integrating the Performance Object with perfLogger

«
»

This set of JavaScript Assessment Questions and Answers focuses on “Integrating the Performance Object with perfLogger”.

1. How many properties does a prototype object have?
a) 6
b) 7
c) 8
d) 9
View Answer

Answer: b
Explanation: The prototype is an object that is associated with every functions and objects by default in JavaScript, where function’s prototype property is accessible and modifiable and object’s prototype property (aka attribute) is not visible. There are a total of 7 properties in the prototype object namely:

  1. perceivedTime
  2. redirectTime
  3. cacheTime
  4. dnsLookupTime
  5. tcpConnectionTime
  6. roundTripTime
  7. pageRenderTime.
advertisement

2. Which of the following does not serialize the undefined values or objects within an object?
a) JSON.string
b) JSON
c) JSON.stringify
d) JSON.change()
View Answer

Answer: c
Explanation: JSON.stringify does not serialize undefined values or functions within an object. JSON.stringify() converts a JavaScript object into a string.

3. How many properties are there in the interface PerformanceTiming?
a) 21
b) 22
c) 23
d) 24
View Answer

Answer: a
Explanation: Performance.timing read-only property returns a PerformanceTiming object containing latency-related performance information. There are a total of 23 properties associated with the interface PerformanceTiming.

4. How many properties are there in window.performance object?
a) 1
b) 4
c) 2
d) 3
View Answer

Answer: c
Explanation: The Window interface’s performance property returns a Performance object, which can be used to gather performance information about the current document. There are totally 2 properties associated with the window.performance and they are:

  • navigation
  • type.
advertisement

5. What is the purpose of the navigation property in the window.performance object?
a) To which page the user navigated
b) How the user navigated
c) Information about the page
d) Information of the curser
View Answer

Answer: b
Explanation: The navigation tells how the user navigated to the page.

6. What is the purpose of the property PerformanceTiming.navigationStart?
a) Ready to end the navigation
b) Ready to jump the navigation
c) Ready for navigation
d) Ready to changing the navigation
View Answer

Answer: c
Explanation: The PerformanceTiming.navigationStart read-only property returns an unsigned long long representing the moment, in milliseconds since the UNIX epoch, right after the prompt for unload terminates on the previous document in the same browsing context. If there is no previous document, this value will be the same as: PerformanceTiming.fetchStart.

7. Which of the following does JSON.stringify not serialize?
a) Undefined values
b) Functions within an object
c) Both Undefined values and Functions within an object
d) Functions outside the object
View Answer

Answer: c
Explanation: JSON.stringify does not serialize undefined values or functions within an object. JSON.stringify() converts a JavaScript object into a string.
advertisement

8. What is the purpose of the property PerformanceTiming.fetchStart?
a) Browser ready to fetch input
b) Browser ready to fetch document
c) Browser ready to fetch summary
d) Browser ready to fetch output
View Answer

Answer: b
Explanation: The PerformanceTiming.fetchStart read-only property returns an unsigned long long representing the moment, in milliseconds since the UNIX epoch, the browser is ready to fetch the document using an HTTP request. If there is no previous document, this value will be the same as PerformanceTiming.fetchStart.

9. Which of the following property is associated with the Request event?
a) requestStart
b) requestEnd
c) both requestStart and requestEnd
d) requestchange
View Answer

Answer: a
Explanation: The Request event has only one property: requestStart. The Request event has only one property: requestStart.

10. Which of the following API can be used to get the timing without affecting the page loading process?
a) Navigation API
b) Timing API
c) Navigation Timing API
d) Navigate API
View Answer

Answer: c
Explanation: The Navigation Timing API provides data that can be used to measure the performance of a web site. The timing code is on the page, so it affects how the page loads and the time that takes. The Navigation Timing API can be used to get the timing without affecting the page loading process.
advertisement

Sanfoundry Global Education & Learning Series – Javascript Programming.

To practice all areas of JavaScript Assessment Questions, here is complete set of 1000+ Multiple Choice Questions and Answers on Javascript.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn