Welcome! Please see the About page for a little more info on how this works.
In cljs:
cljs
ClojureScript 1.10.238 app:cljs.user=> (defn f [a] a) (f) #'cljs.user/f ---- Compiler Warning on <cljs form> line:1 column:2 ---- Wrong number of args (0) passed to cljs.user/f 1 (f) ^--- ---- Compiler Warning ---- nil app:cljs.user=> (defn f [a] a) (apply f []) #'cljs.user/f nil
In clj:
clj
> (defn f [a] a) (f) #'redacted.ns/f Execution error (ArityException) at redacted.ns/eval28662 (form-init217321140160545149.clj:2261). Wrong number of args (0) passed to: redacted.ns/f > (defn f [a] a) (apply f []) #'redacted.ns/f Execution error (ArityException) at redacted.ns/eval28665 (form-init217321140160545149.clj:2265). Wrong number of args (0) passed to: redacted.ns/f
In cljs, apply silently returns nil, while in clj, an ArityException is thrown.
nil
ArityException
This is a host environment difference. JS functions never throw when called with too few or too many arguments. CLJS does not try to change this.