Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Firefox 57
Windows
Other
2025 years ago
Test name Executions per second
while (array.length > 0) { array.pop(); } 244042480.0 Ops/sec
while (array.pop()) {} 20742202.0 Ops/sec
array.length = 0; 36276292.0 Ops/sec
array = []; 82441488.0 Ops/sec
Script Preparation code:
Tests:
  • while (array.length > 0) { array.pop(); }

  • while (array.pop()) {}

  • array.length = 0;

  • array = [];


;