3 ms·
I think this is a bad use of `NULL`. You should instead use a list of all possible solutions, or a sublist of that list (if you only need one solution) because
by geocar 10y ago
I think this is a bad use of `NULL`.
You should instead use a list of all possible solutions, or a sublist of that list (if you only need one solution) because then the empty list can indicate there are no solutions.
If you then want to do something you can iterate over the list: This will protect you from "null pointer" exceptions, promote more functional programming, and is usually less code as well.
js: if(x !== null) { … }
q: $[not null x;…;'`oops]
versus:
js: x.map((r) => …)
q: {…} each x