0

I pulling html from another page to grab some li elements from it.

Will $(response) get garbage collected?

function onResponse(response){
    var $keep = $(response).find(".results li").clone();
    items.push($keep);
    $target.append($keep);
}

JSBIN

Shanimal
  • 11,517
  • 7
  • 63
  • 76
  • http://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management – AmmarCSE Jul 15 '15 at 18:47
  • I don't think standard GC applies because $(response) may have additional GC consequences, not immediately obvious. (e.g. ejohn.org/apps/workshop/adv-talk/#10 implies I have to `.remove()` for garbage collection to take place, but do i even need that since I haven't yet done an append?) – Shanimal Jul 15 '15 at 23:49

0 Answers0