Rest parameters

Treats arguments as an array

function foo( {
  console.log(bar.join(' ')); // Logs 'I can haz teh arguments'
foo('I', 'can', 'haz', 'teh', 'arguments');


  1. It is like arguments but the rest parameters is a real array.
  2. You just can have one rest parameter per function and has to be in the last position.
  3. You can't use arguments

results matching ""

    No results matching ""