Is it enough to print a string in ClojureScript?

How to use cljs.pprint to return a string?

 (cljs.pprint/pprint '(foo bar)) 

It would be desirable to return a line, but not to have a side effect of its printing. A.

Similar to this question, but for CLJS, not CLJ.

How can I print a PersistentHashMap in Clojure for a string?

+8
clojure clojurescript
source share
1 answer

This should work:

 (with-out-str (cljs.pprint/pprint '(foo bar))) 
+12
source share

All Articles