Script Preparation code:
AخA
 
var items = [{
        val: 7
    },
    {
        val: 9
    },
    {
        val: 8
    },
    {
        val: 3
    },
    {
        val: 12
    },
    {
        val: 34
    },
    {
        val: 7
    },
    {
        val: 512
    }
]
Tests:
  • Map and Math.min

     
    Math.min(...items.map(item => item.val))
  • Reduce without initial value

     
    items.reduce((acc, current) => acc < current.val ? acc : current.val)
  • Reduce with initial value

     
    items.reduce((acc, current) => acc < current.val ? acc : current.val, items[0].val)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Map and Math.min
    Reduce without initial value
    Reduce with initial value

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Chrome 84 on Linux
View result in a separate tab
Test name Executions per second
Map and Math.min 910430.1 Ops/sec
Reduce without initial value 2347956.2 Ops/sec
Reduce with initial value 1831322.9 Ops/sec