Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
IE 11
Windows
Other
2025 years ago
Test name Executions per second
while (array.length > 0) { array.pop(); } 77837176.0 Ops/sec
while (array.pop()) {} 51471392.0 Ops/sec
array.length = 0; 32096818.0 Ops/sec
array = []; 14911745.0 Ops/sec
Script Preparation code:
Tests:
  • while (array.length > 0) { array.pop(); }

  • while (array.pop()) {}

  • array.length = 0;

  • array = [];


;