Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142239

"I need to sort an array of songs by the top 5 bands with most songs" [closed]

$
0
0

sort an array by top 5

I have created an object Playlist with an array of songs, I need a method that returns an array with songs only from the five top artists, I honestly have tried different approaches with no success at all, I am not looking for the code, I am just looking for a hint so I can try something different. Thanks

this is the constructor of my class:

'''function Playlist(name){
    this.name = name;
    this.songs = new Array();
    this.shuffled = false;'''
    }
function Song(title, artist, duration, score){
    this.title = title;
    this.artist = artist;
    this.duration = duration;
    this.score = score; 
    this.currentSongIndex = 0;
    }

Viewing all articles
Browse latest Browse all 142239

Trending Articles