I'm debugging some code, and have boiled my problem down to this one simple example:
(js/console.log (.-hey (clj->js {:hey "please work!"})))
prints undefined
It must have something to do with renaming during advanced optimizations, but I can't figure out what's going on, nor how to fix it...
If you use an online CLJS REPL, like http://clojurescript.net/, it works as expected (returns nil but prints please work!), but under advanced optimizations using cljsbuild, it doesn't work at all!
Hrmm, any idea where I'm botching this up?
Edit:
Upon further reflection, and some advice from clojurians on slack, this is because the optimization mangles the keywords, I think, when I use clj->js.
I find that I (think) I need to do this though since I'm trying to interop with the D3.js library (from cljsjs), and when I pass it things, it's expecting js objects, not cljs objects. Is there an idiomatic way of passing in cljs objects to a js library that you're interoping with? (If that is indeed my problem?)
agetfor the index of the vector. That works too, thanks for the response!