js/ namespace

special namespacesince v0.0-927Edit

Use a JavaScript variable.

  • js/document - the global document object
  • js/console.log - the global console log function


Everything 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:

;;=> #<[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:

;;=> #inst "2015-07-14T00:25:33.881-00:00"

See Also: