Working with array of Objects is like working with native types, with the exception that a position in the Array can be null, so it must be taken in consideration when the script is being developed, as in the following example:
A null value in the Java array is translated to a null javascript value automatically by the framework.
TypeError: undefined not callable (property 'forEach' of [object Object])
at [anon] (../../../frida-gum/bindings/gumjs/duktape.c:65012)
at /examples.js:278
at input:1
var peopleArray = ArrayType.getAllPeople();
for (var i = 0; i < peopleArray.length; i++) {
if (peopleArray[i] == null) {
console.log(i + " - null");
} else {
console.log(peopleArray[i].getId()+" - "+peopleArray[i].getName() + " - " + peopleArray[i].getAge());
}
}