I want my object property to return the number of children of each section:
function getFB (category){
        var num;
        firebase.database().ref(category).once('value', (snapshot) => {
            num = snapshot.numChildren()
            return (num);
            console.log(num);
        })
  }
 const menu = [
    { // to json/firebase
        title: 'category1',
        subtitle: getFB('category1'),
    },
    { // to json/firebase
        title: 'category2',
        subtitle: getFB('category1'),
    },
  ]
It does give me the number in the console log, but is not printing it back as the value of "subtitle".
What can I do?