Within my code, I am utilizing both a function and a loop:
var songs = Musics.searchSongs(query).then(function(rs) {
return rs;
});
for (var i = 0; i < songs.length; i++) {
console.log(songs[i]);
}
I am now looking for a way to execute the loop with the data returned from running the function. How can this be accomplished?