title: Usage of rest parameter and spread operator in javascript
body: <p>What's the usage of rest parameter that will be added in ECMAScript 6?</p>
  
  <p>For example, in ECMAScript 5 you can do the following to get an array of parameters starting from the second element:</p>
  
  <pre><code>// ES 5
  store('Joe', 'money');
  store('Jane', 'letters', 'certificates');
  function store(name) {
    var items = [].slice.call(arguments, 1); //['money'] in first case
    items.forEach(function (item) {
      vault.customer[name].push(item);
    });
  }
  </code></pre>
  
  <p>and that will be equivalent to the following code in ECMAScript 6:</p>
  
  <pre><code>// ES 6
  store('Joe', 'money');
  store('Jane', 'letters', 'certificates');
  function store(name, ...items) {
    items.forEach(function (item) {
      vault.customer[name].push(items)
    });
  }
  </code></pre>
  
  <p><strong>Is the difference between them is just syntax or there's a performance issue?</strong></p>
  
  <p><strong>Also for spread operator  (...)</strong></p>
  
  <pre><code>//in ecmascript5
  var max = Math.max.apply(null, [14, 3, 77]);
  //but in ecmascript6
  var max = Math.max(...[14, 3, 77]);
  </code></pre>
  
  <p>Is this just syntax change or performance issue?</p>