jkabot
12/14/2018, 8:53 PM!!results === true
reptar
12/14/2018, 8:55 PMif (results) {
to weed out null values...reptar
12/14/2018, 8:55 PMstalbert
12/15/2018, 3:09 PM!!
coercion to bool... it seems native truthy/falsey covers most use cases for this. The exception for me is if I require a boolean for strong typing (e.g. something in TypeScript requires a boolean). I'd love to hear other ideas on using (or not using) !!
jkabot
12/17/2018, 3:30 PM!!
will likely have the same effects as if you did not use !!
.
I sometimes use it when it knowing that a symbol is a boolean (and not, e.g. an array) improves the clarity of the code,
or if I am returning a value from a function the return value should definitely be a boolean and not leak e.g. an array of results.