1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
const MAX = 10000; var arr = []; var str = ""; for (var i = 0; i < MAX; ++i) { /x/.test(str); str = str + 'xxxxxxxxxxxxxx'; arr.push(str); } arr.length = Math.floor(MAX/3); gc(); for (var i = 0; i < MAX; ++i) { /x/.test(arr[i]); }