I'm working on a music player for a project and I'm trying to add an onclick function to play the individual songs when the song image is clicked.

In order to do this, I need to click the image and get access to the song file to then store that file in state which can the be passed to my music player.

I want to know how can I access all properties of an object by clicking an image from that object?

```js
const songs = [
  {
    artist: 'Kings of Leon',
    songName: 'Pyro',
    poster: KingsOfLeon, // This will be the image that's going to be clicked
    songFile: KingsOfLeonPyro // This is what I need access to for my state
  }
  ]
```