tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

arrays-shrinking-2.js (217B)


      1 // Using shift to cut values out of an array does not change the next index of an existing iterator.
      2 
      3 var a = [1, 2, 3, 4, 5, 6, 7, 8];
      4 var s = '';
      5 for (var v of a) {
      6    s += v;
      7    a.shift();
      8 }
      9 assertEq(s, '1357');