4 ms·
you get a warning from the compiler in ClojureScript when type coercion happens: cljs.user=> (+ "1" 1) ⬆ WARNING: cljs.core/+, all argument
by yogthos 8y ago
you get a warning from the compiler in ClojureScript when type coercion happens:
cljs.user=> (+ "1" 1)
⬆
WARNING: cljs.core/+, all arguments must be numbers, got [string number] instead. at line 1
"11"
You can also use Spec and Schema to validate data at the edges, so that you don't end up with unexpected inputs. I highly recommend doing that for any non-trivial projects.