title: Is it possible to change the value of the function parameter?
body: <p>I have one function with two parameters, for example <code>function (a,b)</code>. I want to within the function, take the value of b, and replace that with c. I was thinking of something like <code>$(b).replaceWith(c)</code>, but it didn't work out. I know I can create a new variable within the function with the new value, but is it possible to change the value of b itself? Is something like this possible. Or are the parameters set in stone?</p>
  
  <p>Let me try to explain what I am trying to do. There are three functions, one overarching function and then two functions within it which are triggered by toggle event. And I want the second function to do something to get a value and pass it on to the third function. So here would be the code</p>
  
  <pre><code>function(a,b){
  
      $('selector').toggle(
  
          //I want this to gather a value and store it in a variable
          function(){},
  
          //and I want this to accept the variable and value from the previous function
          function(){}
      )}
  </code></pre>
  
  <p>The only way I can think of doing this is to add a parameter c for the overarching function and then modify it with the first function and have the new value pass on to the second function.</p>