Files
30-seconds-of-code/test/everyNth/everyNth.js
2018-08-02 13:49:33 +03:00

3 lines
101 B
JavaScript

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