Updated all, any, none

Merged them with their by counterparts.
This commit is contained in:
Angelos Chalaris
2018-02-16 13:43:43 +02:00
parent 15d6b42d5b
commit 9cbdbe5656
22 changed files with 58 additions and 135 deletions

View File

@ -0,0 +1,9 @@
const mostPerformant = (fns, iterations = 10000) => {
const times = fns.map(fn => {
const before = performance.now();
for (let i = 0; i < iterations; i++) fn();
return performance.now() - before;
});
return times.indexOf(Math.min(...times));
};
module.exports = mostPerformant;