Given collection of vectors of separated hash-maps
How can I go from :
[[{:a 1} {:b 2} {:c 3}] [{:a 4} {:b 5} {:c 6}] [{:a 7} {:b 8} {:c 9}]]
To:
[[{:a 1 :b 2 :c 3}] [{:a 4 :b 5 :c 6}] [{:a 7 :b 8 :c 9}]]
Thanks you for your answers!
(def coll [[{:a 1} {:b 2} {:c 3}] [{:a 4} {:b 5} {:c 6}] [{:a 7} {:b 8} {:c 9}]])
(mapv (fn [v] [(apply merge v)]) coll)
;; => [[{:a 1 :c 3 :b 2}] [{:a 4 :c 6 :b 5}] [{:a 7 :c 9 :b 8}]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With