special namespace | since v0.0-927 | Edit |
Use a JavaScript variable.
js/document
- the global document objectjs/console.log
- the global console log functionEverything after the js/
namespace is passed through to the compiled
JavaScript.
The following examples are run from a browser REPL.
Get the JavaScript global document
object:
js/document
;;=> #<[object HTMLDocument]>
Display an alert:
(js/alert "Hello World")
;; displays alert popup
Log to console:
(js/console.log "Hello World")
;; displays in developer console
Create a JavaScript date object:
(js/Date.)
;;=> #inst "2015-07-14T00:25:33.881-00:00"