title: Jasmine Spy to return different values based on argument
body: <p>I am spying a JS method. I want to return different things based on actual argument to the method. I tried callFake and tried to access arguments using arguments[0] but it says arguments[0] is undefined. 
  Here is the code - </p>
  
  <pre><code> spyOn(testService, 'testParam').and.callFake(function() {
       var rValue = {};
       if(arguments[0].indexOf("foo") !== -1){
           return rValue;
       }
       else{
           return {1};
       }
   })        
  </code></pre>
  
  <p>This is suggested here - <a href="https://stackoverflow.com/questions/16198353/any-way-to-modify-jasmine-spies-based-on-arguments">Any way to modify Jasmine spies based on arguments?</a></p>
  
  <p>But it does not work for me.</p>