title: Confuse about javascript function's call method
body: <p>I read an article about <a href="http://www.nczonline.net/blog/2009/01/13/speed-up-your-javascript-part-1/" rel="nofollow">how speed up javascript</a>, I try copy it's code which could improve loop speed:</p>
  
  <pre><code>var chunk = function (array, process, context) {
          setTimeout(function(){  
              var item = array.shift();  
              console.log('item', item);//this could show correctly
              process.call(item, context);  
  
              if (array.length &gt; 0){  
                  setTimeout(arguments.callee, 100);  
              }  
          }, 100); 
      }
  </code></pre>
  
  <p>Then I try to pass my parameter into it, but I don't know how to use the <code>context</code> parameter, what I have done is:</p>
  
  <pre><code>  var dosomething1 = function (item) {
        console.log('this is begin ' + item)
    }
  
    var dosomething2 = function (item) {
        console.log('this is end ' + item);
    }
  
    var process = function (item) {
          console.log(item); //this show undefined
          dosomething1(item);
          dosomething2(item);
    }
  
    var temp = ["a", "b", "c", "d"];
    chunk(temp, process);​
  </code></pre>
  
  <p>The problem is begin in the process function, the <code>item</code> log <code>undefined</code>, the item could only show correctly in <code>chunk</code>.</p>
  
  <p>So how can I solve this problem?I think it related to the <code>process.call</code> method?Is it related to the context parameter?</p>
  
  <p>You can see the demo <a href="http://jsfiddle.net/hh54188/NrBmD/1/" rel="nofollow">here</a></p>