DEV Community

Discussion on: 1 line of code: How to get every odd item of an Array

 
jonrandy profile image
Jon Randy 🎖️ • Edited

You might want to make the benchmark call the functions as well as define them! :P

Thread Thread
 
giulio profile image
Giulio "Joshi"

wouldn't jumping 2 steps ensure only odd positional, but not values?
(I just assume an unsorted array of random values)

Thread Thread
 
jonrandy profile image
Jon Randy 🎖️

Odd positional is what we're after

Some comments have been hidden by the post's author - find out more