Some help with for loops and children of a gameobject

I’m not really sure how I would turn off the renderer of all of a gameobject’s children. I have this script so far:

var exampleobject : GameObject;
for (var gameobjectchildren : GameObject in exampleobject)
    gameobjectchildren.renderer.enabled = false;

Yes, I have example object defined. How would I do this?

first you wanna get every component MeshRenderer in the objects children,
then iterate through them and disable them


var meshrenderers : MeshRenderer[];

 function Update(){
  meshrenderers = gameObject.GetComponenetsInChildren(MeshRenderer);
   for(var meshrenderer : MeshRenderer in meshrenderers){
    meshrenderer.enabled = false;

didn’t test this so not sure if it works, it should though