title: JavaScript partially applied function - How to bind only the 2nd parameter?
body: <p>Sorry if I'm missing something obvious, but I can't figure out how to bind a specific (nth) argument of a function in javascript.  Most of my functional programming I've learned has been from Scala so I'm not sure this is even possible in JS.</p>
  
  <p>For example, I understand I can do the below to bind the 1st argument</p>
  
  <pre><code>var add = function (a, b) {
     return a + b;
  };
  
  add(1, 3); //returns 4
  
  var addThree = add.bind(null, 3);  //this = null.  a = 3
  addThree(4);                        //returns 7
  </code></pre>
  
  <p><strong>But how can I bind the 2nd argument and leave the first as is. In other words how can I bind to 'b' only?</strong>   </p>
  
  <p>From what i can tell from mozilla - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind</a>   , the arguments are actually nested which makes it look like it has to be in specific order?  (I'm very possibly reading this wrong)</p>
  
  <p>Edit:
  I realize this is a sort of contrived example.  I'm just trying to learn in case I eventually deal with something more complex than adding 2 numbers.  I'm also trying to understand how the bind() arguments are actually working under the hood.</p>