Its not strictly the same. '1' is a number whereas '!0' is a boolean.
I hate that language a bit more now
Both 1 and true are truthy, but not the same. That would work if the variable was only ever used in if(x), conditions, etc. Stringifying won't produce the same value either when passing values as well.
Because 1 !== true and 0 !== false in JavaScript:
const index = "Hello HN".indexOf("H")
console.log(index);
>> 0
index == false
>> TRUE
index === false
>> FALSE