Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: uniq
node v10.24.1
version:
master
endpoint
share
tweet
const uniq = require("uniq") const arr1 = Array.from(Buffer.allocUnsafe(1e4)); const arr2 = arr1.slice(); console.time('uniq') for(let i = 0; i < 1e4; ++i) { uniq(arr1); } console.timeEnd('uniq') console.time('set') for(let i = 0; i < 1e4; ++i) { const arr3 = [...new Set(arr2)] } console.timeEnd('set')
Created from: https://npm.runkit.com/uniq
Loading…
no comments
sign in
to comment