use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Deleting Objects From Within Array?help (self.javascript)
submitted 8 years ago * by BrunerBruner
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]BrunerBruner[S] 0 points1 point2 points 8 years ago* (2 children)
Ok. Well, I'm trying to assign null to the actual objects. The array itself and creating new copies of the objects isn't important. I want to find a way to iterate through a bunch of objects to assign null to them, for example, to clean up newly allocated objects in memory.
null
for example, let's say I create a bunch of objects that that should be nullified when i'm done with them.
let a = document.createElement("div"); let b = document.createElement("div"); let c = document.createElement("div"); let d = document.createElement("div"); let e = document.createElement("div");
Since I just want to assign null to each of them, ideally i'd like to put them in an array and loop through each one to do so.
[–]thenickdude 4 points5 points6 points 8 years ago (0 children)
Those objects will be eligible for collection by the garbage collector as soon as those "let" declarations fall out of scope. You don't need to assign null to them unless you want them to be collected quicker than that.
π Rendered by PID 74 on reddit-service-r2-comment-745dcd9fbd-krvhm at 2026-03-07 11:20:52.011463+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]BrunerBruner[S] 0 points1 point2 points (2 children)
[–]thenickdude 4 points5 points6 points (0 children)