Files
30-seconds-of-code/test/everyNth/everyNth.js
2018-01-17 13:40:40 -05:00

2 lines
100 B
JavaScript

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