Skip to content
RED SAG Skills
medium10 pts · first answer countsweb-performancememory

Leak through a closure

Why might this code keep a 50 MB array in memory for as long as the page is open?

const bigData = loadHugeArray()
button.addEventListener('click', () => {
  console.log(bigData.length)
})
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions