-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting.txt
39 lines (33 loc) · 1.04 KB
/
testing.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
if(auth.currentUser != null){
db.collection("clubs").get().then((snapshot) =>{
let i = 0;
eventList = new Array();
snapshot.forEach((doc) => {
db.collection("clubs").doc(doc.id).collection("events").get().then((snapshot1) =>{
snapshot1.forEach(doc1 => {
eventList[i] = doc1.data();
eventList[i].clubname = doc.data().name;
i++;
});
});
});
console.log(eventList)
res.render("admin/admin_homepage",{eventList: eventList});
}).catch((err) => {
console.log(err);
});
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50);
console.log(num);
});
console.log('Done');
}
start();
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
//------------------------------------------------------