I'm using firebase data-base.
After deleting an object, snapshot will return an array with a length longer than the actual array values:
fireBase.ref(REFS_CATEGORIES_ONE_TIMERS).once('value', function (snapshot) {
const values = snapshot.val(); // This array will contain 2 valus with leanth of 3
returnFunc(extract);
});
Array content:
myArray[0] : SomeObject;
myArray[2] : SomeObject;
When looping over this array, it will loop 3 times, on time the value will be undefined.
How can I remove missing entries in an more 'elegant' way than looping over?