Files
30-seconds-of-code/test/everyNth/everyNth.js
2018-02-04 17:38:39 +02:00

2 lines
100 B
JavaScript

const everyNth = (arr, nth) => arr.filter((e, i) => i % nth === nth - 1);
module.exports = everyNth;