Test name | Executions per second |
---|---|
Lodash uniqBy | 2244967.0 Ops/sec |
Set | 1926319.2 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var MyArr = Array.from({length: 40}, () => Math.floor(Math.random() * 40));
var myCopy = null;
myCopy = _.uniqBy(MyArr);
myCopy = [new Set(MyArr)]