Do we need to unset variables in JavaScript, and why?
For example in PHP it's recommended to unset all temporary variables in all kind of loops to keep memory free and avoid variables duplicates.
But anyways according to php - what's the benefit of unsetting variables? question:
Is it true that unsetting variables doesn't actually decrease the memory consumption during runtime? -Yep.
So should we delete window.some_var;
?
Or we should use some_var = null
?
Or we should not unset variables to avoid additional CPU cycles?
UPD: Related questions: