I have total 25 song list in spotify, it may increase in future. Like 1, 2, 3, 4 ..... 25. In my case the map() function show only top 10 song (1 to 10). when a new song add in my playlist it got position from 26th number like 26, 27, 28 ..... n value.
Now, how I can order my map() function? I want to show 25, 24, 23, 22.... like (Z to A)
Anyone can help me?
const tracks = items.slice(0, 10).map((track: ResponseTrackType) => ({
artist: track.artists.map((_artist) => _artist.name).join(', '),
songUrl: track.external_urls.spotify,
cover: track.album.images[1]?.url,
title: track.name
}));
I want to replace slice() to ascending, descending order.