Velotio interview question

How would you handle memory leaks in JavaScript.