I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
It's not really coercion, or I don't think it goes that far. It's just that !! is saying "make this a boolean if it's "truthy" and you can just use the "is it truthy" instead.
Casting to boolean is only useful if you're going to do something like supply it to an API that expects a boolean.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's not really coercion, or I don't think it goes that far. It's just that
!!
is saying "make this a boolean if it's "truthy" and you can just use the "is it truthy" instead.Casting to boolean is only useful if you're going to do something like supply it to an API that expects a boolean.