How does one use cljs.pprint
to return a string?
(cljs.pprint/pprint '(foo bar))
Would like this to return a string, rather than have a side effect of printing it.
Similar to this question, but for CLJS, not CLJ.
How can I pretty print a PersistentHashMap in Clojure to a string?
This should work:
(with-out-str (cljs.pprint/pprint '(foo bar)))
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