check if a function is not false and use it's value without calling it again
<p>Hi i would like to know if there's a good way to check if a function return something and have a fallback if it return false. </p>

<pre><code>function setPage(hash){
    for(k = 0; k&lt;magazine.pages.length ; k++ )
    {
        if( magazine.pages[k][2] == hash )
        {
            return k;
            break;
        }
    }
    return false;
};

var actualPage = ( !hash ? 0 : setPage(hash.replace('#', '')) ? setPage(hash.replace('#', '')) : 0 )} );
</code></pre>

<p>I'd like to avoid the setPage() function to be called twice while i can't store it's value before as i want it to be called only if hash is true. Is it possible to do it whithout sacrifiing the short syntax ?</p>
