1 <script> 2 var x = "x"; 3 4 for (var i = 1; i < 23; ++i) { 5 x = x + x; 6 } 7 8 // x should now be a 2^23 character string, which is 16M in size. 9 10 var y; 11 12 // now append to it repeatedly in a way that prevents buffer sharing 13 for (var i = 0; i < 1000; ++i) { 14 y = x + i; 15 } 16 </script> 17