macro | since v0.0-2341 | Edit |
(js-str s)
Convert s
to string using JavaScript's coercion behavior.
Equivalent to ''+s
in JavaScript.
(js-str 23)
;;=> "23"
(js-str #js {:foo 1})
;;=> "[Object object]"
(core/defmacro js-str [s]
(core/list 'js* "''+~{}" s))