Im having trouble accessing items in an array after pushing data into it from Firebase.
const rootref = firebase.firestore().collection("Projects");
const projectList = []
rootref.get().then(function(querySnapshot){
querySnapshot.forEach(function(doc) {
projectList.push(doc.data())
});
});
//this returns all items in the list
console.log(projectList)
//this returns null
console.log(projectList[0]);