title: How do I assign a string to a variable using an anonymous function in the variable declaration?
body: <pre><code>var destURL = function () {
              if (this.typeOfDash == 'edit') {
                  return '../../ajax/getParams.aspx';
              }
              else {
                  return 'DashCreator.aspx';
              }
  </code></pre>
  
  <p>}</p>
  
  <p>I was hoping that would work but it just assigns the function to the variable... I was hoping to get the returned value as the variables value... anyone?</p>