ExamVeda
Login
Home
71
What is the purpose of lazy loading?
Discuss
Answer & Solution
Answer: Option C
Solution:
Lazy loading is a kind of loading in which we don’t need our JavaScript code to be available as soon as the page loads.
72
Where is the external JavaScript placed in the case of lazy loading?
Discuss
Answer & Solution
Answer: Option A
Solution:
When we don’t need our JavaScript code to be available as soon as the page loads, we can script-load our external JavaScript after the window.onload event.
73
What are the parameters of the attachEvent function?
Discuss
Answer & Solution
Answer: Option C
Solution:
The attachEvent function accepts two parameters: the event to attach to, and the function to invoke when the event occurs.
74
What is the result when the showPerformanceMetrics() is called before loading the remote script?
Discuss
Answer & Solution
Answer: Option B
Solution:
If you try to make the call to perfLogger.showPerformanceMetrics() and the script hasn’t just loaded but also executed, then you will get an error.
75
Which of the following is an attribute to the script object?
Discuss
Answer & Solution
Answer: Option B
Solution:
Only onload is an attribute to the script object.
76
Which is the method used to add an event listener?
Discuss
Answer & Solution
Answer: Option A
Solution:
The addEventListener() method is used to add an event listener to the script.
77
What is the purpose of the domLoading attribute?
Discuss
Answer & Solution
Answer: Option D
Solution:
The domLoading attribute is used when the document begins to load.
78
How is the render time calculated?
Discuss
Answer & Solution
Answer: Option B
Solution:
The render time is calculated as Date.Now() – performance.timing.domLoading.
79
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
Discuss
Answer & Solution
Answer: Option D
Solution:
The properties of the prototype object are inhertied by all instances of the class, and properties whose values are functions behave like instance methods of the class.
80
You can refresh the webpage in JavaScript by using
Discuss
Answer & Solution
Answer: Option B
Solution:
One can refresh the webpage in JavaScript by using location.reload.