When i print my item counter the value is still 0 even there is a data on it but if i print the itemcount below on increment it shows the right value. Please help me I also use firebase on this
I want the right value of item counter because it always shows a 0 value
here is the code :
var itemCounter = 0;
get(queGadget).then((snapshot)=>{
snapshot.forEach(childSnapshot => {
++itemCounter;
});
})
console.log(itemCounter)