I need some help with the CS0029 error

So in the Unity Learn; Junior Programmer: Create with Code 2; Unit 4 Bonus Features 4, I was doing part 2, and I wanted to make it so the harder enemy can only spawn if the player passes wave 4, so I wrote this code:

//Top of the script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class spawnManager : MonoBehaviour
{
    public int enemyCount;
    public GameObject[] enemyPrefab;
    public GameObject powerUp;
    private float spawnBound = 9.0f;
    public int waveNumber = 1;


//Function that controls what will spawn when

private void SpawnEnemyWave(int enemySpawnCount)
    {

      int enemyToSpawn;
        for (int i = 0; i < enemySpawnCount; i++)
        {
            if (waveNumber < 4)
            {
                enemyToSpawn = enemyPrefab[0];
            }
            else
            {
                enemyToSpawn = Random.Range(0, enemyPrefab.Length);
            }

            Instantiate(enemyPrefab[enemyToSpawn].gameObject, GenerateSpawnPos(), enemyPrefab[enemyToSpawn].gameObject.transform.rotation);
        }
    }

But when I save it and go into unity i get:
"Assets\Scripts\spawnManager.cs(41,32): error CS0029: Cannot implicitly convert type ‘UnityEngine.GameObject’ to ‘int’’

pls help

tanks

The problem might be here:

  int enemyToSpawn;   / You declared enemyToSpawn as int /
         for (int i = 0; i < enemySpawnCount; i++)
         {
             if (waveNumber < 4)
             {
                 enemyToSpawn = enemyPrefab[0];  / then tried to assign a gameObject/

I guess you wanted to set enemyToSpawn = 0 ?