Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

270
Vistas
Do I have to delete the node or the garbage collector does the work in JS?

To delete the last node of the circular link list in JS, I will traverse to the second last node and I will link the second last node with the first node, the last node is now disconnected from the chain. Now is it necessary to delete the last node like in c++, doesn't garbage collector of JS does the work ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

JavaScript handles freeing memory through the use of the garbage collector. As long as there are no longer any references pointing to an object, where all references have moved out of scope, it will be garbage collected. You don't need to worry about freeing memory yourself.

One thing to note in your use case is the limitation of circular references. Specifically when you have a situation where object A references object B, A->B; and object B references object A, B->A. Even if both A and B move out of scope and nothing else references them, they will not be garbage collected as both object still have "1 reference" from eachother.

I believe "most" modern browsers and runtime environments now support Mark & Sweep, and if they're not accessible should also be garbage collected, solving this issue.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda