How is it that if statements check types?
<p>I come from a C# background and need to become more familiar with JS.  I'm reading a book and in this example:</p>

<pre><code>var as = document.getElementsByTagName('a');
for(var i=0;i&lt;as.length;i++){
    t=as[i].className;
    //Check if a link has a class and if the class is the right one
    if(t &amp;&amp; t.toString().indexOf(popupClass) != -1)
    {
       //...
    }
</code></pre>

<p>Part of the <code>if</code> statement doesn't make sense.  What is <code>if(t)</code>?  I am used to if statements checking boolean values, but <code>t</code> is a string, right?  </p>
