title: How to assign a keys of an array as a function's parameters?
body: <p>I have a JavaScript module that exported with arrow function with 3 parameters, the following example:</p>
  
  <p>// getMonth.js module</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default (date, type, ...rest)  =&gt; {
    // Represent this return exmaple
    return date + ' ' + type + ' ' + rest
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>In the main file, I have an array that I want to Assign the keys of the array as function's parameters</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import getMonth from '../modules/month.js'
    
  let splitedParams = ['2016/07/14', 'full']
  
  getMonth({date, type, ...rest} = splitedParams)</code></pre>
  </div>
  </div>
  </p>
  
  <p>But this implementation isn't right and I got some error, How can I do this?</p>
  
  <p>Thanks</p>