Having Problems Programming I Need Some Help With This Script

Im bad at programming. I was following this guys youtube video and he ran this script and had no problems with it. When I run it I get
"Assets/MasterSpawnScript.js(40,17): BCE0044):expecting ), found ‘enemyCounter’.
when I tried to remove the script I got like 20 more errors. Here is the script

 #pragma strict

var spawnPoints : Transform[];
var enemyPrefabs : GameObject [];

var yieldTimeMin = 2;
var yieldTimeMax = 5;

static var enemyCounter = 0;

var spawnXOffsetMin = 0;
var spawnXOffsetMax = 0;

var spawnZOffsetMin = 0;
var spawnZOffsetMax = 0;

var defaultSpawnNumber = 5;

var waveNumber = 1;

var isSpawning = false;

function SpawnEnemies(wave : int)
{
	var spawnNum = (defaultSpawnNumber + 5 * (wave - 1));
	
	isSpawning = true;
	
	for(var i = 0; i < spawnNum;i++)
	{
		yield WaitForSeconds(Random.Range(yieldTimeMin, yieldTimeMax));
		
		var object : GameObject = enemyPrefabs[Random.Range(0, enemyPrefabs.Length)];
		var positions : Transform = spawnPoints[Random.Range(0, spawnPoints.Length)];
		
		Instantiate(object, position.position + 
			Vector3(Random.Range(spawnXOffsetMin, spawnXOffsetMax, 0,
				Random.Range(spawnZOffsetMin, spawnZOffsetMax)), position.rotation)
		
		enemyCounter++;	
		
	}

	isSpawning = false;
}

function UpdateWave ()
{
	waveNumber++;
	SpawnEnemies(waveNumber);
}
function Start () 
{
	SpawnEnemies(waveNumber);
}

function Update () 
{
 if(enemyCounter == 0 && !isSpawning)
 {
 	UpdateWave();
 }

} 

Make sure that you close all the parenthesis in your scripts and make sure you have a semi-colon at the end of your statements. The error is caused by this line:

Instantiate(object, position.position + 
			Vector3(Random.Range(spawnXOffsetMin, spawnXOffsetMax, 0,
				Random.Range(spawnZOffsetMin, spawnZOffsetMax)), position.rotation)

The code should read like this:

Instantiate(object, transform.position + 
			Vector3(Random.Range(spawnXOffsetMin, spawnXOffsetMax), 0,
				Random.Range(spawnZOffsetMin, spawnZOffsetMax)), transform.rotation);

As a note, whenever you run into an error that says “expecting ____, found ____” that generally means there is a parenthesis that isn’t closed, or there is a semi-colon missing.

Finally, when you are reading your error message pay attention to the line and column numbers listed like this: Assets/MasterSpawnScript.js(40,17) 40 is the line number the error is on and 17 is the column or character position of the error. Find that position in your file and work your way from that to track down the issue. In this case, since there was an expected not found error, you can look at that line and work backward through the code to find any missing semi-colons or parenthesis that caused the issue.