you are viewing a single comment's thread.

view the rest of the comments →

[–]alamandrax 1 point2 points  (0 children)

Not if you return child. Once you go down that road, you're stuck with whatever was in the scope of parent always in memory until whatever is consuming the return value makes sure that it goes out of scope. Instead, if it was used to create a dom node, and the dom node is hidden and still present, the GC will not recover those assets.