Question · JavaScript and TypeScript course · Module 10: TypeScript in Practice

Types of Memory Leaks

What is the most common cause of memory leaks in JavaScript?

Answer options

  • Forgotten event listeners, timers and unneeded references (e.g. in global objects or closures)
  • Using template literals
  • Using const instead of let
  • Too many local variables in a function

You can check the correct answer by solving this task in the CodeWorlds game.