Vidyalelo
JavaScript · Q35

Invocation And Performance Navigation

Programming · JavaScript · question 35

Q35

What is the purpose of garbage collection?

A.
Removes object with many reference
B.
Removes object with reference
C.
Removes object with invalid reference
D.
Removes object with no reference
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
When the interpreter sees an object in the heap with no object references, it removes that object from the heap. This is called garbage collection.