help with spawning objects

unity always freeze when I prees play. I think there is a problem with for loop but i cant figure it out.
heres the code im using.
var ball: GameObject;

var ball: GameObject;
 
function Start() {
    var ballNum = 3;
    for (var i = 0; i <= ballNum; i++){
        var position = Vector3(Random.Range(1, 10), 0, 0);
        Instantiate(ball, position, Quaternion.identity);
     }
}

I don’t see anything wrong with the loop itself. Are you assigning something to ball?

Seems like either spamming Debug.Log() or putting break points should give you the answer quickly.

for (var i : int = 0; i <= ballNum; i++)

you didn’t declare i correctly, change the for line to what I show above