title: I am trying to delay this function without using any built in Methods. Why wont this work?
body: <pre><code>function delay(func, wait){ 
  var timer = new Date().getTime() + wait;
  var end = new Date().getTime()
  for(var i = 0; i &lt; 1000000000; i++){
  if(timer === end){
      return func(arguments[2], arguments[3])
      }
  else{
      end = new Date().getTime()
   }
   }
  }
  console.log(delay(function(first,second) { return first + second},500,200,300));
  </code></pre>
  
  <p>I have been messing with this for a while and havent figured out whats wrong. Also id there is any much simple way to do this let me know.</p>