1 line of code: How to get every n-th item of an Array
const nthItems = (arr, pos) =&gt; arr.filter((arr, index) =&gt; index % pos === pos - 1);       ...
Tags: javascript, webdev, productivity, codequality