In javascript is -1 true or false?
<p>I can't figure out if -1 is true or false in javascript, when I use indexOf.</p>

<pre><code>let a =  'abc'.indexOf('abc');  
let b =  'def'.indexOf('abc');   

console.log(a);     // 0
console.log(b);     // -1
console.log(!a);    // true
console.log(!b);    // false
</code></pre>

<p>Why are the last two lines giving true/false?</p>

<p>From what I understand only == allows for type converting, since (=== is strict)</p>

<p>Is (!a) and (!b) using (==) internally somewhere?</p>