Abc (v2)

Revision 2 of this benchmark created on


Setup

const arr = [{year: 2024}, {year: 2023}, {year: 2022}]

Test runner

Ready to run.

Testing in
TestOps/sec
Reduce
return arr.reduce((accumulator, curr) => Math.max(accumulator, curr.year), 0) || new Date().getFullYear();
ready
Math Max
const years = arr.map(obj => obj.year);
return years[0] || new Date().getFullYear();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.