Thanks a lot for all your comments and advice. I’ve got the answer now, and here it is:
let inputArray = [];
snapshot.forEach(snap => {
inputArray.push(snap.val());
return false;
});
solved Firebase: getting value of a child without knowing its key