Filter Performance

node v10.24.1
version: master
endpointsharetweet
const unique = require('youneek'); const times = (count, fn) => Array(...Array(count)).map((_, i) => fn(i)); const random = () => Math.floor(Math.random() * 20 + 1); /* Generate 10,000 numbers between 1 and 20 */ const data = times(10000, random); data.filter(unique());
Loading…

no comments

    sign in to comment