I've been following this tutorial https://ilikekillnerds.com/2017/05/convert-firebase-database-snapshotcollection-array-javascript/ in order to convert a firebase snapshot into an array in my ionic application. This is the code I have:
And this is my data structure in firebase:
When I use my code this is the error it gives me:
And when I debbug that line of code where the error seems to be, I can see that the first item in the snapshot is stored in the array, then the next value is undefined. Although if I just print the keys it prints just fine:
Anyone has any idea what's going on?



booleanproperties in your database likeboolLoginanddisponible. hence when you are using foreach to iterate the values and add a key to them you are getting this error because it's trying to add key to theitemeven when it has boolean value in this lineitem.key=childSnapshot.key;