Rewriting javascript to C# ....

Hi,

i have to rewrite an unityscript in c# and im new to c#. Sure you can help me by this:

My javascript code looks like this:

 for(var mat : MeshRenderer in matComp){
if(mat.renderer.material.name == "xyz"){
    		mat.renderer.sharedMaterial.color = colors[counter];
    	}

My attempt was this, but i get an error "expecting ","...

for(MeshRenderer mat in matComp){...}

Would be great to know, if theres an short overview or comparision between javascript and c#, isnt it?

Thanks a lot, yosh

You should try foreach instead of for

http://msdn.microsoft.com/en-us/library/ttw7t8t6%28VS.80%29.aspx

Regarding the secondary question, "is there an overview..." - FYI, I did put up a list for C# at:

Syntax Differences in C#/JS