Pergunta de entrevista da empresa SmartNews

What causes memory leak in JavaScript and how to deal with them? How would you locate memory leaks in your code?