Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object array for vs foreach vs for..in vs for..of
Compare loop performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0
Browser:
Firefox 141
Operating system:
Windows
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
for
744985792.0 Ops/sec
foreach
243755.8 Ops/sec
for in
5328601.0 Ops/sec
for..of
245611.6 Ops/sec
Script Preparation code:
var array = new Array([ [ { "name": "Oleg Knox", "phone": "(310) 920-5482" }, { "name": "Donna Castaneda", "phone": "1-863-829-4852" }, { "name": "Mariko Colon", "phone": "(844) 852-3112" }, { "name": "Ria Morales", "phone": "1-477-926-8509" }, { "name": "Whoopi Hewitt", "phone": "(839) 561-4791" }, { "name": "Quynn Monroe", "phone": "(631) 447-0232" }, { "name": "Graiden Stanton", "phone": "(525) 769-5457" }, { "name": "Abraham Jacobs", "phone": "(644) 639-2672" }, { "name": "Tatum Gibbs", "phone": "(763) 857-7477" }, { "name": "Dacey Dickson", "phone": "1-490-310-7555" }, { "name": "August Miranda", "phone": "1-682-236-4516" }, { "name": "Malik Castaneda", "phone": "(340) 624-8892" }, { "name": "Brandon Chandler", "phone": "(347) 478-4637" }, { "name": "Kirk Mack", "phone": "(715) 925-4632" }, { "name": "Devin Sears", "phone": "1-567-177-2373" }, { "name": "Devin Guy", "phone": "1-498-263-2204" }, { "name": "Ainsley Lynn", "phone": "1-688-558-2641" }, { "name": "Brenden Atkinson", "phone": "(378) 193-6464" }, { "name": "Phoebe Robles", "phone": "(822) 285-7133" }, { "name": "Breanna Berger", "phone": "1-698-717-5074" }, { "name": "Lani Zamora", "phone": "(760) 401-3735" }, { "name": "Kelly Cortez", "phone": "1-286-202-4217" }, { "name": "Marny Alston", "phone": "1-391-945-9160" }, { "name": "Rhoda Barber", "phone": "1-660-847-6761" }, { "name": "Acton Villarreal", "phone": "(871) 455-6411" }, { "name": "Arden Lucas", "phone": "(384) 546-8108" }, { "name": "Kiayada Luna", "phone": "(872) 416-3124" }, { "name": "Raven Bullock", "phone": "(383) 277-4521" }, { "name": "Cara Hopper", "phone": "(875) 402-3638" }, { "name": "Victoria Brennan", "phone": "1-269-223-5438" }, { "name": "Alfreda Pope", "phone": "1-496-991-8632" }, { "name": "Irene Dejesus", "phone": "(217) 389-6445" }, { "name": "Daphne Hays", "phone": "1-428-327-8136" }, { "name": "Sylvia Whitehead", "phone": "1-985-732-6807" }, { "name": "Keefe Calhoun", "phone": "1-208-367-6021" }, { "name": "Jane Beasley", "phone": "(420) 703-9897" }, { "name": "Bo Browning", "phone": "1-934-285-0799" }, { "name": "Cain Ferguson", "phone": "(558) 303-2938" }, { "name": "Tashya Rodgers", "phone": "1-781-852-7964" }, { "name": "Amanda Willis", "phone": "(622) 485-2878" }, { "name": "Thaddeus Jimenez", "phone": "(242) 169-3543" }, { "name": "Riley Kline", "phone": "(427) 417-8803" }, { "name": "Vladimir Boyle", "phone": "(544) 820-4531" }, { "name": "Davis Monroe", "phone": "1-680-852-8331" }, { "name": "Chester Cash", "phone": "(471) 266-7077" }, { "name": "Jordan Sparks", "phone": "1-326-753-2814" }, { "name": "Emmanuel Reynolds", "phone": "(418) 891-8014" }, { "name": "Garrison Rush", "phone": "(117) 826-3854" }, { "name": "Freya Knight", "phone": "(553) 455-8021" }, { "name": "Christian Buckley", "phone": "(416) 118-3880" }, { "name": "Tana Atkinson", "phone": "(642) 314-2118" }, { "name": "Edan Christian", "phone": "(835) 830-8148" }, { "name": "Drew Mueller", "phone": "1-215-749-6647" }, { "name": "Christen Jacobson", "phone": "(373) 219-6869" }, { "name": "Liberty Martinez", "phone": "(568) 473-4557" }, { "name": "Isaac Garrison", "phone": "1-475-262-1128" }, { "name": "Catherine Mclaughlin", "phone": "(260) 664-2336" }, { "name": "Risa Glenn", "phone": "1-949-744-1771" }, { "name": "Iola Fowler", "phone": "1-328-241-8230" }, { "name": "Macaulay Garner", "phone": "(938) 807-9356" }, { "name": "Bo Nicholson", "phone": "1-582-749-1731" }, { "name": "Benjamin Harrison", "phone": "(942) 419-1076" }, { "name": "Reagan Mejia", "phone": "(881) 188-4971" }, { "name": "Hayfa Curtis", "phone": "1-826-931-8771" }, { "name": "Dawn Strong", "phone": "1-647-833-2844" }, { "name": "Anthony Cantrell", "phone": "(833) 877-1131" }, { "name": "Alice Hayes", "phone": "1-954-265-4018" }, { "name": "Giacomo Hopkins", "phone": "(584) 246-6864" }, { "name": "Orson Sims", "phone": "1-791-612-2646" }, { "name": "September Compton", "phone": "(146) 318-7398" }, { "name": "Randall Key", "phone": "(666) 516-4651" }, { "name": "Gavin Grant", "phone": "1-854-665-8232" }, { "name": "Charissa Ballard", "phone": "(259) 747-6412" }, { "name": "Kareem Guthrie", "phone": "1-826-341-6410" }, { "name": "Oren Everett", "phone": "(653) 204-4204" }, { "name": "Kyle Peterson", "phone": "1-646-686-3911" }, { "name": "Bruno Case", "phone": "(322) 643-7873" }, { "name": "Rana Humphrey", "phone": "(402) 657-9452" }, { "name": "Linus Whitley", "phone": "(343) 104-5917" }, { "name": "Cade Whitaker", "phone": "1-782-682-5877" }, { "name": "Vielka Chase", "phone": "(512) 614-7045" }, { "name": "Guy Lamb", "phone": "1-817-755-7863" }, { "name": "Shad Mcmahon", "phone": "(545) 177-1282" }, { "name": "Gwendolyn Nichols", "phone": "(238) 762-2316" }, { "name": "Tatum England", "phone": "(228) 107-9079" }, { "name": "Charles Berger", "phone": "1-821-633-5100" }, { "name": "Fallon Burgess", "phone": "1-496-998-6268" }, { "name": "Quemby Rios", "phone": "1-586-287-6853" }, { "name": "Byron Zimmerman", "phone": "1-487-503-0852" }, { "name": "Brynne Joseph", "phone": "(121) 266-0677" }, { "name": "Lance Perry", "phone": "(387) 385-4518" }, { "name": "Camilla Gilmore", "phone": "(755) 963-5465" }, { "name": "Lance Smith", "phone": "1-486-269-1290" }, { "name": "Remedios Nelson", "phone": "(510) 431-9715" }, { "name": "Ainsley Harding", "phone": "(412) 703-9919" }, { "name": "Roary Cannon", "phone": "1-697-584-5508" }, { "name": "Elvis Richardson", "phone": "1-253-559-6215" }, { "name": "Charles Hampton", "phone": "(198) 418-2605" }, { "name": "Carol Jackson", "phone": "1-720-826-7566" }, { "name": "Alea Neal", "phone": "(867) 699-1166" } ] ]);
Tests:
for
for (var i = 0; i < array.length; i++) { array[i]; }
foreach
array.forEach(function(i) { array[i]; });
for in
for (var i in array) { array[i]; }
for..of
for (var i of array) { array[i]; }