Hi Thomas,

Thankyou very much for the explanations and examples. All worked fine in both 
simple and advanced compilation. I was about to try aget, but the examples I 
found were using integer indexes so assumed (wrongly) I couldn't use it here 
with strings.

I'll have a look at the inspect things you mention, but you've moved me along 
nicely for now.

Would you know if the original syntax used in both examples I linked changed in 
clojurescript or would it have been a restify change? I can't see how they ever 
compiled previously, as I don't recognise it from my readings.

Cheers,
Mark

On Monday, 10 March 2014 09:22:06 UTC, Thomas Heller  wrote:
> Hey,
> 
> there are many ways to get the properties of a javascript object, but if you 
> want to rely on advanced compilation and might miss some externs its probably 
> best to use aget.
> 
> (let [name (aget req "params" "name")] ...)
> 
> But these work too
> 
> (.. req -params -name)
> (-> req .-params .-name)
> 
> If you want to print an object you could do (pr-str (js->clj obj)), or use 
> some of the inspect things node has (I think).
> 

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to