javascript print variable1 || variable2
<p>I have a file that has an extention either:</p>

<pre><code>.doc or .docx
</code></pre>

<p>I wanted to link it this way:</p>

<pre><code>document.getElementById("file").innerHTML = "View file sent &lt;a href='../folder/filename" +
(what syntax do I need to add here if I wanted to print which extention file is exist on that folder)
</code></pre>

<p>In PHP we can do this</p>

<pre><code>var1 = ".doc";
var2 = ".docx";

var1 ? var1 : var2;
</code></pre>

<p>What is the equivalent of this in JavaScript?</p>
