문제

For some reason, I create a temporal HTML element using document.createElement(). The element is not appended to the document tree. I make a new element every mousemove(). Does that allocate any type of memory that I need to deallocate when I am done with the element? How?

도움이 되었습니까?

해결책

If you don't add the element to the DOM or keep any other references to it, they will be freed by the garbage collector. There's no need to manually destroy them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top