title: Javascript object function with options
body: <p>I am trying to create a function with options. I believe I have to use objects but have failed so far. By options I mean something like that:</p>
  <pre><code>insertButton({
      settings:{
          value1:'Some text'      
      }
  });
  
  function insertButton(settings){
      settings = new Object();    
      document.write(settings.value1);
  }
  </code></pre>
  <p>Obviously, that won't work but I am trying to show what I mean. Maybe someone could help.</p>
  <p>I am asking because right now I have simple function where I can pass values with strict order. With options I want to be undependable of variables order in function. For example:</p>
  <pre><code>function insertButton2(value1,value2,value3){
      document.write(value1);
      document.write(value2);
      document.write(value3);   
  }
  
  insertButton2('a','','c');  //empty commas to skip value2 
  </code></pre>
  <p>Leaving empty commas to make sure 'c' is value3 is not convenient for me. That is why I would like to try objects, options.</p>