title: Passing in undefined as a parameter in a function (ES6)
body: <p>I have a question pertaining to the usage of es6 functions that have default parameters.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>const add = (a = 1, b = 2) =&gt; a + b;
  </code></pre>
  
  <p>As you can see, <code>a</code> and <code>b</code> default to <code>1</code> and <code>2</code> respectively.</p>
  
  <p>With default values, I can call the function without any parameters like so:</p>
  
  <pre><code>add(); // 3
  </code></pre>
  
  <p>I can also omit parameter <code>b</code>:</p>
  
  <pre><code>add(2); // 4
  </code></pre>
  
  <p>And to omit parameter <code>a</code>, I can pass in <code>undefined</code>:</p>
  
  <pre><code>add(undefined, 3); // 4
  </code></pre>
  
  <p>My question:</p>
  
  <p>Is it bad practice to pass in <code>undefined</code> as a first parameter in order for the function to be called with the default first parameter, which in this instance is <code>1</code>?</p>