Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


RunKit + npm: uniq

node v10.20.1
version: master
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

no comments

    sign in to comment