title: JavaScript function with optional parameters
body: <p>I'm new to JavaScript coming from Python background. In Python parameters can be passed as key and value as such:</p>
  
  <pre><code>def printinfo( name, age = 35 ):
     print "Name: ", name
     print "Age ", age
     return;
  </code></pre>
  
  <p>Then the function could be called as such:</p>
  
  <pre><code>printinfo( age=50, name="miki" )
  printinfo( name="miki" )
  </code></pre>
  
  <p>Can such parameters be passing in JavaScript functions?</p>
  
  <p>I want to be able to pass one or more parameter. For example a JavaScript function as such:</p>
  
  <pre><code>function plotChart(data, xlabel, ylabel, chart_type="l"){
      ...
  } 
  </code></pre>
  
  <p>I want to be able to pass only data and chart type and labels are optional such as :</p>
  
  <pre><code>plotChart(data, chart_type="pie")
  </code></pre>
  
  <p>Is this possible with JavaScript?</p>