Fork me on GitHub
#specter
<
2023-11-28
>
itaied12:11:00

Hi all, how can I pick only the odds values in an array?

[:a 0 :b 1 :c 2] => [0 1 2]

rolt13:11:10

there may be something easier, but something like that should work: [INDEXED-VALS (pred #(odd? (first %))) LAST]

itaied13:11:24

I ended up doing [(sp/view #(apply hash-map %)) sp/MAP-VALS]

👎 1
rolt13:11:31

you're hashing for no reason. If you want to go that route I'd use (partition-all 2 %)