HeroName = new Hero() HeroName.Spells = []; HeroName.Spells[0].Type = [];
This does not work = (even if I try a new Array () or anything else. Can't make arrays inside arrays? This is what I was going to do:
HeroName.Spells[0].Type[0] = new DmgSpell(); HeroName.Spells[0].Type[1] = new Buff();
I know I can do something like
HeroName.Spells[0][0] = new DmgSpelL(); HeroName.Spells[0][1] = new Buff();
But it's not so easy to read
Am I doing something wrong? I tried all possible combinations that I could think of, and using Google to search for an array in an array gives me other results that don't help me. Any help is appreciated
source share