In my search, I have come across a few answers that are similar, but not quite what I need.
Within an array called SongList
, which I will show with just 2 items for brevity, the first pair is a key and the second pair is some JSON data.
SongList={
song_1:{title:"title of first song",artist:"the artist",mp3:"http://mysite/song1.mp3"},
song_2:{title:"title of second song",artist:"the artist",mp3:"http://mysite/song2mp3"}
...
};
I am looking to retrieve the key (song_1
or song_2
) based on the value of the title
.
My plan is to iterate through a temporary array containing i
items. Each item in this array should match a key in the SongList
, and I will store these keys (song_1
, song_2
) in a final array.