0
votes

I am testing om (https://github.com/omcljs/om) and I don't understand whats happen here:

I have a Clojure code that consume a API and put data into a vector. Then in my ClojureScript code I try:

(def urls (map (fn [c] (get c :url )) billings))
(def n (first urls))

(println n) ;; correct value
(.log js/console n) ;; null

Someone can explain this behavior ?

Thanks

1

1 Answers

1
votes

If you are using a REPL, then println will—assuming you haven't issued (enable-console-print!)—generally print to your REPL. But, console.log goes to your browser's console output.

When you invoke (.log js/console n), the REPL only prints the return value of console.log, so you see nil.