title: Multiple arguments vs. options object
body: <p>When creating a JavaScript function with multiple arguments, I am always confronted with this choice: pass a list of arguments vs. pass an options object.</p>
  
  <p>For example I am writing a function to map a nodeList to an array:</p>
  
  <pre><code>function map(nodeList, callback, thisObject, fromIndex, toIndex){
      ...
  }
  </code></pre>
  
  <p>I could instead use this:</p>
  
  <pre><code>function map(options){
      ...
  }
  </code></pre>
  
  <p>where options is an object:</p>
  
  <pre><code>options={
      nodeList:...,
      callback:...,
      thisObject:...,
      fromIndex:...,
      toIndex:...
  }
  </code></pre>
  
  <p>Which one is the recommended way? Are there guidelines for when to use one vs. the other?</p>
  
  <p>[Update] There seems to be a consensus in favor of the options object, so I'd like to add a comment: one reason why I was tempted to use the list of arguments in my case was to have a behavior consistent with the JavaScript built in array.map method.</p>