Script Preparation code:
AخA
 
var stringArray = Array.from({
    length: 9999
}, () => `${Math.floor(Math.random() * 100)}`);
Tests:
  • Set spread

     
    const setSpread = [... new Set(stringArray)]
  • Set array from

     
    const arrayFromSet = Array.from(new Set(stringArray))
  • Filtered array

     
    const filteredArray = stringArray.filter((i,index) => stringArray.indexOf(i) === index)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Set spread
    Set array from
    Filtered array

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Set spread 5987.7 Ops/sec
Set array from 5837.1 Ops/sec
Filtered array 261.9 Ops/sec