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

1 line
84 B
JavaScript

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