I would like to understand what kind of code causes memory leaks in JavaScript and created the script below. However, when I run the script in Safari 6.0.4 on OS X the memory co
I tried to do something like that and got exception out of memory.
const test = (array) => { array.push((new Array(1000000)).fill('test')); }; const testArray = []; for(let i = 0; i <= 1000; i++) { test(testArray); }