return a value via function math result that is stored in a variable
<p>i was trying to get a result of the browsers  window width and trying to put the result of math and condition in a variable , this is the code </p>

<pre><code>var MyWidth = 1900;
var MyHeight = 900;
var height = $(window).height();
var width = $(window).width();

var AutoW = function () {
    if ( (MyWidth / width).toFixed(2) &gt; 0.95 )
          return 1;
    if ( (MyWidth / width).toFixed(2) &lt; 1.05 )
          return 1;
    else return (MyWidth / width).toFixed(2);
     };


alert(AutoW);
</code></pre>

<p>the problem is i don't know the right syntax or structure of the function assigned to the variable</p>

<p>what is the right way to code this ?</p>
