title: Javascript function call to have optional attributes
body: <p>Can a function be defined in javascript in a way that attributes are optional in a function call? </p>
  
  <p>for example, I have the below function defined: </p>
  
  <pre><code>function abc(x1,y1,x2,y2){
  //execution
  }
  </code></pre>
  
  <p>What I am willing to do is something like this: </p>
  
  <pre><code>function abc(x1,y1,x2,y2,id){
  if(id!=''){
  //do something
  }else{
  // do something else
  }
  }
  </code></pre>
  
  <p><strong>function call: abc(1,2,3,4);</strong> </p>
  
  <p>Will the above function still work or give an error? </p>