pretty printing in cljs

clojure, clojurescript

Solution

UPDATE: ClojureScript now has a full port of clojure.pprint in the form of cljs.pprint.

There's also a fipp which is narrower in scope and likely a bit faster.

Problem

I am trying to pretty print a JSON from clojurescript, on the browser's console. I found the following link - How can I pretty-print JSON using JavaScript? The above link provides the following js - `JSON.stringify(obj, undefined, 2)` The following translation in cljs doesnt work `(.stringify js/JSON obj undefined 2)` - Is there any native way in cljs for pretty printing? - Any ideas why the above cljs expression doesnt work ?

Original source

Related problems