Script Preparation code:
AخA
 
var array = Array.from({length: 40}, () => Math.floor(Math.random() * 140));
Tests:
  • Set spread

     
    const f = [... new Set(array)]
  • Array from set

     
    const s = new Set(array)
    const l = Array.from(s)
  • Filter

     
    const b = array.filter((i,index) => array.indexOf(i)!== index)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Set spread
    Array from set
    Filter

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15
Safari 12 on Mac OS X 10.14.5
View result in a separate tab
Test name Executions per second
Set spread 166111.8 Ops/sec
Array from set 162484.9 Ops/sec
Filter 291543.5 Ops/sec