Files
30-seconds-of-code/test/everyNth/everyNth.js

2 lines
99 B
JavaScript

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