Is there a function in Clojure that always returns nil no matter what the input is?
I know I could write (fn [_] nil) but is there a built-in function?
You can use constantly
to return a function which always returns the given value e.g.
(constantly nil)
Note the returned function takes an arbitrary number of parameters while yours only allows one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With