Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8963371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:20:24+00:00 2026-06-15T16:20:24+00:00

I wrote a quick and dirty implementation of a doubly-linked list for javascript. I

  • 0

I wrote a quick and dirty implementation of a doubly-linked list for javascript. I would like to be able to remove multiple (consecutive) nodes at once, and was wondering: is it enough to just sever the ends of these outer most nodes I am removing, or do I have to remove each node individually. If I understand javascript’s garbage collection correctly, once nothing points to those consecutive nodes any more even when they are still connected with each other, they should be taken care of by the garbage collector, is that correct?
If anyone could tell me how I could test or verify this myself, I would highly appreciate that as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:20:25+00:00Added an answer on June 15, 2026 at 4:20 pm

    According to MDN:

    As of 2012, all modern browsers ship a mark-and-sweep garbage-collector. All improvements made in the field of JavaScript garbage collection (generational/incremental/concurrent/parallel garbage collection) over the last few years are implementation improvements of this algorithm, but not improvements over the garbage collection algorithm itself nor its reduction of the definition of when “an object is not needed anymore”

    Mark and sweep algorithms begin from the root objects and find all reachable objects then collect all the non-reachable ones, so for these browsers severing the nodes will be fine. Older browsers use reference counting, which means objects are only collected once they have 0 references to them, so in this case the cycles of a doubly linked list will be problematic. You would then need to cut the cycles in the consecutive nodes in some way (setting the references to null, delete keyword, so on).

    So if you are developing for moden browsers you’re all good, but you’ll need a slightly more involved solution if you want back compatibility to browsers like IE6/7 (it’s always the way, isn’t it…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently wrote a quick and dirty BFS implementation, to find diamonds in a
I have a JTable in a swing application. I wrote a quick and dirty
I wrote a quick and dirty wrapper around svn.exe to retrieve some content and
I wrote a quick and dirty web service in VB.NET. And as it always
I wrote a quick and dirty function to compare file contents (BTW, I have
I wrote a quick and dirty logger as a jQuery plugin... (function($){ $.log =
I love being able to write quick and dirty query strings right into the
I recently wrote a quick-and-dirty proof-of-concept proxy server in C# as part of an
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate
I wrote a quick Perl script to query the local DNS servers for an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.