So I have 2 playlists created in my database with a playlistName and id. I am trying to display a list of playlists that I have created. I was able Console.log(playlists) to get an array of my 2 objects with the right data in it. but I can't have access to my objects in my array. I tried forEach, map, even just looking at the first index, I always get undefined in my console. Would love some assistance. View Image for console results snipit

```js
function getPlayLists(b) {
  firebase.auth().onAuthStateChanged(function (user) {
    if (user) {
      var uid = auth.currentUser.uid;
      var playlists = [];
      database.ref(uid).on("value", function (snapshot) {
        snapshot.forEach(function (childSnapshot) {
          playlists.push({
            playlistName: childSnapshot.val().name,
            id: childSnapshot.val().idKey,
          });
        });
      });
      console.log(playlists);
      console.log(playlists[0]);
    } else {
      console.log("No user is signed in.");
    }
  });
}
```

[enter image description here](https://i.stack.imgur.com/NAl8i.jpg)