JavaScript Questions & Answers – Performance Navigation and Memory – I

«
»

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Performance Navigation and Memory – I”.

1. How many read-only attributes are present in the navigator object?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation: The navigator object contains information about the browser. There are a total of 2 read-only attributes present in the navigator object namely:

  1. redirectCount
  2. type.
advertisement

2. Why are HTTP redirects significant?
a) TCP connection available
b) Complete roundtrip absent
c) Complete roundtrip present
d) TCP connection not available
View Answer

Answer: b
Explanation: HTTP redirects are significant because they cause a complete roundtrip for each redirect. The original request is returned from the web server as either a 301 or a 302 with the path to the new location.

3. Where does the DNS reply go to in a single HTTP redirect?
a) Browser
b) Client
c) Server
d) DNS Server
View Answer

Answer: a
Explanation: DNS is a query/response protocol. The client queries information (for example the IP address corresponding to www.google.com) in a single UDP request. The DNS reply goes to the Browser in a single HTTP redirect.

4. How can one access the redirectCount property?
a) navigation.redirectCount
b) performance.navigation.redirectCount
c) performance.redirectCount
d) redirectCount
View Answer

Answer: b
Explanation: The redirectCount property can be accessed as performance.navigation.redirectCount. The PerformanceNavigation.redirectCount read-only property returns an unsigned short representing the number of REDIRECTs done before reaching the page.
advertisement

5. How many constant values can the property type be represented?
a) 2
b) 3
c) 4
d) 5
View Answer

Answer: c
Explanation: The type property sets or returns the value of the type attribute of an <object> element. The type attribute specifies the Internet media type (formerly known as MIME type) of the object. Totally 4 constant values can be represented by the property type.

6. Which of the following constants has the value 255?
a) TYPE_NAVIGATE
b) TYPE_RELOAD
c) TYPE_BACK_FORWARD
d) TYPE_RESERVED
View Answer

Answer: d
Explanation: TYPE_BACK_FORWARD performs navigation through a history traversal operation. TYPE_RESERVED Has the value of 255 and is a catch-all for any navigation type not defined above.

7. What is the purpose of the constant TYPE_RELOAD?
a) Reload performed
b) Reload not performed
c) Reload must be performed
d) Reload may be performed
View Answer

Answer: a
Explanation: TYPE_RELOAD: Has the value of 1, indicating that the current page was arrived at via a reload operation. TYPE_RELOAD performs navigation through the reload operation or the location.reload() method.
advertisement

8. What does the constant TYPE_BACK_FORWRD indicate?
a) Navigation via browser history
b) Navigation via user request
c) Navigation via URL
d) Navigation via load operation
View Answer

Answer: a
Explanation: TYPE_BACK_FORWARD performs navigation through a history traversal operation. TYPE_BACK_FORWARD Has the value of 2, indicating that the page was navigated to via the browser history, either using the back or forward buttons or programmatically through the browser’s history object.

9. Which of the following constants hold the value 2?
a) TYPE_NAVIGATE
b) TYPE_RELOAD
c) TYPE_BACK_FORWARD
d) TYPE_RESERVED
View Answer

Answer: c
Explanation: TYPE_BACK_FORWARD performs navigation through a history traversal operation. TYPE_BACK_FORWARD: Has the value of 2, indicating that the page was navigated to via the browser history, either using the back or forward buttons or programmatically through the browser’s history object.

10. Where does the DNS Lookup direct to ?
a) Browser
b) Client
c) Server
d) DNS Server
View Answer

Answer: d
Explanation: DNS is a query/response protocol. The client queries an information (for example the IP address corresponding to www.google.com) in a single UDP request. The DNS Lookup directs to the DNS Server.
advertisement

Sanfoundry Global Education & Learning Series – Javascript Programming.

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