for (i=1; i<9; i++) {
if (this["blank"+i].getChildAt(0) is Letters) {
word += this["blank"+i].getChildAt(0).letter;
}
}
This code throws a range exception if, for instance, “blank2” doesn’t contain any children.
I just need to be able to basically say, “if this blank doesn’t have any children, just skip this code.”
Normally I would do something along the lines of an if=null statement, but this won’t work here because
if (this["blank"+i.getChildAt(0) != null)
obviously throws the same range exception.
How do you deal with this? I can’t find anything along the lines of a “does blank1 contain any children” sort of method.R