Created
July 21, 2011 22:17
-
-
Save mjg123/1098372 to your computer and use it in GitHub Desktop.
function to turn a clojure map into a js map in ClojureScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn make-js-map | |
"makes a javascript map from a clojure one" | |
[cljmap] | |
(reduce #(aset %1 (name (first %2)) (second %2)) (js-obj) cljmap)) | |
; (make-js-map {:a "Hello"}) returns "Hello", not the js-map :( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment