forEach
JavaScript performance comparison
Preparation code
<script>
const employee = [
{
companyName: "xyz.com",
age: 26,
role: "Software Engineer",
salary: 35000,
timeSpent: 3
},
{
companyName: "My Traveler",
age: 28,
role: "Senior Software Engineer",
salary: 65000,
timeSpent: 2
},
{
companyName: "Product Wheel",
age: 31,
role: "Lead Engineer",
salary: 90000,
timeSpent: 3
},
{
companyName: "Make My Budget",
age: 35,
role: "Consultant",
salary: 125000,
timeSpent: 4
},
];
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Test | Ops/sec | |
---|---|---|
for loop
|
|
pending… |
forEach
|
|
pending… |
map
|
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit
to the URL.
0 Comments