The first four are the same. In JavaScript, the type of the variable follows the variable name. So here, the type is Collider and the name of the variable is whatever you like.
You just as easily have:
function OnTriggerEnter (MagicalPonies : Collider){}
To clarify, you don’t need the variable declaration in the first line. In JavaScript, anytime you see a “:” after a variable name you’re declaring a new variable. Function signatures just don’t use the “var” keyword, that’s the only difference.
So all you need is:
function OnTriggerEnter (MagicPonies : Collider) {
MagicPonies.renderer.enabled = true;
}
What you’re saying there is that you’re declaring a new “MagicPonies” variable for use inside that function, of type Collider, and whatever’s calling that function will provide the data to fill the variable.
On the last function example in your original post–that’s basically the same function, except a version where the game engine doesn’t pass you the object that entered the trigger. You’d use that when you care that something has entered the trigger, but you don’t care which something.