title: Call a variable inside if else statement
body: <p>I have a quick question on how to call variables inside an if/else statement of a function. My thought looks like this.</p>
  
  <pre><code>var variable = {
      anything
  }
  
  var variable2 = {
      anything
  }
  
  var options = function () {
      if($(this).hasClass(".itemname")){
          return variable
      } else {
          return variable2
      }
  };
  
  $("#items li").click(options);
  </code></pre>