Hi everyone!
Let’s say I have an array like this:
var myArray:Array<Int>;
myArray = new Array<Int>();
myArray[3] = 4;
First of all, is this ok? Am I allowed to fill in random positions in a simple array such as this, while leaving some undefined?
If so, how can I check if a key exists? I’ve tried this:
if (myArray[7] == null) { ... }
and this:
if (myArray.exists(7)) { ... }
and it doesn’t work. Any ideas?