Say I have the following vector
(def x [[1 2 3] [4 5 6] [7 8]])
and I want to add the number 9 to the last vector (I don't know the index of the vector)
(conj (vec (butlast x)) (conj (last x) 9))
Is there a better / clearer way to do this?
source
share