Possible Duplicate:
What does this mean? (function (x,y)){…}){a,b); in JavaScript
I have the following JS code from the Canvas documentation:
 for(var i=0;i<4;i++){  
  for(var j=0;j<3;j++){  
    ctx.beginPath();  
    var x              = 25+j*50;               // x coordinate  
    var y              = 25+i*50;               // y coordinate  
    var radius         = 20;                    // Arc radius  
    var startAngle     = 0;                     // Starting point on circle  
    var endAngle       = Math.PI+(Math.PI*j)/2; // End point on circle  
    var anticlockwise  = i%2==0 ? false : true; // clockwise or anticlockwise  
    ctx.arc(x,y,radius,startAngle,endAngle, anticlockwise);  
    if (i>1){  
      ctx.fill();  
    } else {  
      ctx.stroke();  
    }  
  }  
} 
I want to turn it into a CoffeeScript code. And here it is:
@draw = ->
  canvas = document.getElementById('canvas')
  ctx = canvas.getContext('2d')
  for i in [0..3]
    for j in [0..2]
      ctx.beginPath()
      x = 25 + j * 50
      y = 25 + i * 50
      radius = 20
      startAngle = 0
      endAngle = Math.PI + (Math.PI * j) / 2
      anticlockwise = if i % 2 == 0 then false else true
      ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise)
      if i > 1 then ctx.fill() else ctx.stroke()
Everything works just great, but I have a question regarding the compiled code:
this.draw = function() {
  var anticlockwise, canvas, ctx, endAngle, i, j, radius, startAngle, x, y, _results;
  canvas = document.getElementById('canvas');
  ctx = canvas.getContext('2d');
  _results = [];
  for (i = 0; i <= 3; i++) {
    _results.push((function() {
      var _results2;
      _results2 = [];
      for (j = 0; j <= 2; j++) {
        ctx.beginPath();
        x = 25 + j * 50;
        y = 25 + i * 50;
        radius = 20;
        startAngle = 0;
        endAngle = Math.PI + (Math.PI * j) / 2;
        anticlockwise = i % 2 === 0 ? false : true;
        ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
        if (i > 1) {
          _results2.push(ctx.fill());
        } else {
          _results2.push(ctx.stroke());
        }
      }
      return _results2;
    })());
  }
  return _results;
};
So, why does the '()' brackets appear after return _results2; line? It's not a big deal: the code does its work great, but being a little bit perfectionist, I want to know, how to eliminate these round brackets.
UPD: Thank you. Now I understand, what is the '()'. But still, I have a question: why does it appear?
 
     
     
     
     
    