Invocation And Performance Navigation(Computer Science > Javascript ) Questions and Answers

Question 1. What is the purpose of lazy loading?
  1.    Immediate loading is necessary
  2.    Loading under command
  3.    Immediate loading is not necessary
  4.    None of the mentioned
Explanation:-
Answer: Option C. -> Immediate loading is not necessary

Question 2. Where is the external JavaScript placed in the case of lazy loading?
  1.    After window.onload event
  2.    Before window.onload event
  3.    All of the mentioned
  4.    None of the mentioned
Explanation:-
Answer: Option A. -> After window.onload event

Question 3. What are the parameters of the attachEvent function?
  1.    Function
  2.    Function, Event
  3.    Event, Function
  4.    Event
Explanation:-
Answer: Option C. -> Event, Function

Question 4. What is the result when the showPerformanceMetrics() is called before loading the remote script?
  1.    Throws an exception
  2.    Throws an error
  3.    It will load by itself
  4.    None of the mentioned
Explanation:-
Answer: Option B. -> Throws an error

Question 5. Which of the following is an attribute to the script object?
  1.    onclick
  2.    onload
  3.    onshow
  4.    all of the mentioned
Explanation:-
Answer: Option B. -> onload

Question 6. Which is the method used to add an event listener?
  1.    addEventListener()
  2.    addListener()
  3.    addEvent(Listener)
  4.    addListener(Event)
Explanation:-
Answer: Option A. -> addEventListener()

Question 7. What is the purpose of the domLoading attribute?
  1.    Document exists
  2.    Document can load
  3.    Document has loaded
  4.    Document begins to load
Explanation:-
Answer: Option D. -> Document begins to load

Question 8. How is the render time calculated?
  1.    Date.Now()
  2.    Date.Now() – performance.timing.domLoading
  3.    performance.domLoading
  4.    Date.Now() – performance.domLoading
Explanation:-
Answer: Option B. -> Date.Now() – performance.timing.domLoading

Question 9. The object whose properties are inherited by all instances of the class, and properties whose values are functions behaving like instance methods of the class, is
  1.    Instance object
  2.    Constructor object
  3.    Destructor object
  4.    Prototype object
Explanation:-
Answer: Option D. -> Prototype object

Question 10. You can refresh the webpage in JavaScript by using
  1.    window.reload
  2.    location.reload
  3.    window.refresh
  4.    page.refresh
Explanation:-
Answer: Option B. -> location.reload