title: Javascript Arrays - Find Duplicates
body: <p>Here is my question... </p>
  
  <p><strong>Given an array populated with numbers as a function parameter, produce a resulting array which contains any duplicates number from the array. 
  For example, given the array [ 1, 2, 4, 4, 3, 3, 1, 5, 3 ] it should return [1, 4, 3]. For extra bonus points return a sorted array.</strong></p>
  
  <p>I am starting out with Javascript - I know the language however, using it in the correct way ( as one should ) I'm still getting to grips with. </p>
  
  <p>My pseudo code for this would be to: </p>
  
  <p>Create an array with the numbers above <code>var numbers = [1, 2, 4, 4, 3, 3, 1, 5, 3];</code></p>
  
  <p>Then create an empty array named "result" <code>var result = [];</code></p>
  
  <p>Create a for loop that goes through the var numbers to check for duplicates which will then populate the empty array "result" with the duplicates</p>
  
  <pre><code>for (var i = 0;i &lt; numbers.length; i++) {
   //This is where I'm stuck...
  }
  </code></pre>
  
  <p>I'm not sure what to do within the for loop to populate the var result and to throw in to the mix... The given array has to be a function parameter which makes sense so you can change the numbers in one place. </p>
  
  <p>Any feedback on my thought process on this so far is greatly appreciated but ultimately I am wanting to learn how to achieve this. </p>
  
  <p>Here is a JSFiddle of my progress so far... <a href="http://jsfiddle.net/fbauW/" rel="nofollow">http://jsfiddle.net/fbauW/</a></p>