0

It's not entirely clear to me how Mark-and-sweep algorithm works.

MDN

This algorithm reduces the definition of "an object is no longer needed" to "an object is unreachable".

It turns out that this algorithm works only with references on objects and doesn't clear global variables, functions... at all. Does it?

Ivan
  • 478
  • 2
  • 13
  • 1
    A global variable is per definition reachable. What condition shall justify the sudden disappearance of a global variable? – Holger Apr 14 '21 at 08:34
  • @Holger I see, so it's just about references on objects – Ivan Apr 14 '21 at 09:07

0 Answers0