1

I am using ClojureScript in an interoperability scenario, and I have a public function that is basically a go block. When I call it from my browser console, it returns a ClojureScript object (the result of go).

I would like to return nothing not even undefined (as in return;). How do I do that ?

(defn :^export myFn [cb]
  (go ...)
  js/undefined) ;; what do I put here instead of js/undfined?
0

1 Answer 1

2

In Javascript a return; will return undefined:

(typeof (function() {return;})())
=> "undefined"

Hence your js/undefined is just fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.