求这两代码的区别,上面的代码不能画圆
var hourNumber=[3,4,5,6,7,8,9,10,11,12,1,2];
for(var i=0;i<hourNumber.length;i++){
var rad=2*Math.PI/12*i;
var y=Math.sin(rad)*(r-30);
var x=Math.cos(rad)*(r-30);
xtx.fillText(hourNumber[i],x,y);
}
/*hourNumber.forEach(function(number,i){
var rad =2*Math.PI/12*i;
var y=Math.sin(rad)*(r-30);
var x=Math.cos(rad)*(r-30);
xtx.fillText(number,x,y);
})*/