Difference between Transform vs transform

I am currently watching some video tutorials and i saw the example below (looping through childrens):

for (var children : Transform in transform) {
   ...
}

Whats the difference between Transform and transform ?
What does transform contain and it is used to loop inside it? Is it some kind of an array?

Also is it valid to do the same thing with the code below??:

for (var children : GameObject in gameObject) {
   ...
}

Thanks

Transform is the name of the class that contains the information about a transform. transform is a property of an object that gives you the instance of the Transform for that object. So your for loop defines a looping variable called children (it should really be child) that is going to be a Transform so you get the instance for each child.

Transform itself defines that it can have a for loop run against it and that it will return its children when you do that. The same is not true for GameObject. So to get the children you have to use the transform variable in the for loop. This is because the relationships between objects are defined by transform.parent.

Transform is used to store and manipulate the position, rotation and scale of the objects, you can declare a Transform and drag a object to it, to get it Transform and change it Transform, for example, a Empty GameObject has nothing on it, but you can use it as a Transform to set a Spawn Position to the Player, for example:

var spawn: Transform;
function Update () 
{
   //That will make you object, go to Spawn position
   transform.position =  Spawn.position;
}

Every Object on Unity has a transform, that is represented with the cordinates and rotation value on map

When you call a transform, you are calling the value of the Transform, you can use a transform.position, or a transform.rotation for example, to get the coordinates of the gameObject, for more informations, you can access the Unity documentation that has more informations of Transform here

Written a blog related to it, check the link belowlink text