Derek Chiang
Derek Chiang

Reputation: 3410

Non-recursive js->clj in ClojureScript

I have a JavaScript array of JavaScript objects. I'd like to turn it into a vector of JavaScript objects. However, js->clj is recursive, such that the JavaScript objects themselves would be turned into CLJS maps.

How can I turn a JavaScript array into a CLJS vector without touching the elements inside the array?

Upvotes: 0

Views: 218

Answers (1)

Thomas Heller
Thomas Heller

Reputation: 4366

(vec the-array) or (into [] the-array) will both turn the array into a vector and not touch the objects at all.

Upvotes: 3

Related Questions