1 line of code: How to get every even item of an Array
const evenItems = arr = arr.filter((_, index) =&gt; index % 2 === 0);        Enter fullscreen mode  ...
Tags: javascript, webdev, performance, codequality