title: What happens if I don't pass a parameter in a Javascript function?
body: <p>I am new to the world of Javascript and am tinkering with writing very basic functions and stumbled upon the example below by accident and am unsure why it works when I am not passing a parameter when the function demands it.</p>
  
  <p><strong>Sample function</strong></p>
  
  <pre><code>function myfunction(x) {
      alert("This is a sample alert");
  }
  </code></pre>
  
  <p>Now if I call the function <code>myfunction();</code> I am presented with the alert. Why is that that I am able to call the function without any errors or warnings when I have not passed a parameter?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I did not expect so many great answers and I am by no means in a position yet able to say which answer is the best so am I able to request people to suggest the best answer and I'll award the acceptance to that person. </p>