I am trying to loop through results that I have extracted from a database and write it to elements on a web page.
let customers = snapshot.numChildren();
console.log(customers);
let elements = document.getElementsByClassName('customerNumber');
customers.forEach(customer => {
elements.textContent = customer;
});
I am seeing the results for customers in the console but I am also getting this error: Uncaught (in promise) TypeError: customers.forEach is not a function.
I am not sure what I am doing wrong here.