How can I find the count of Game Objects []

I don’t see a length, count, or size associated with the array spawnPoints. I would like to get the length and store it as a local variable from the array without having to search twice. Is the best way to iterate through the list afterwards and count?

private GameObject [] spawnPoints = GameObject.FindGameObjectsWithTag("SpawnPoint");

You can also make the count with the help of the iteration of foreach loop or otherwise you can use the length of the spawnPoints.

E.g. int count = spawnPoints.Length;


private GameObject spawnPoints = GameObject.FindObjectsWithTag(“SpawnPoint”);

private count;

foreach(GameObject temp in spawnPoints){

   print("Count: "+count);