Is there a shorter way to write this code?

For example something like l.type+type = null; ?

if (type == 0) { l.type0 = null; }
if (type == 1) { l.type1 = null; }
if (type == 2) { l.type2 = null; }
if (type == 3) { l.type3 = null; }
if (type == 4) { l.type4 = null; }
if (type == 5) { l.type5 = null; }

if you put the I.type0 to I.type5 inside an array I.types you could use something like this:

if(type>=0 && type<I.types.length)
{
          I.types[type]=null;
}

of course it will require the type var to be int.
Note: you can’t add up names of vars or any other calculation as a matter of fact.