This is the order I want my movies to be in
This is the code of how I sorted the favorites release_date :
sort_movieDates = () => {
let releases = this.state.favorites.map(favorites=>favorites.release_date)
let newFavorites=this.state.favorites.release_date;
releases.sort();
console.log(releases)
}
What I want to do is that to compare the favorites release_date with the movie details in here . If the favorites release_date match then I want it to be added in that order. For example since Jurassic World: the Fallen Kingdom has the release_date of 2018-06-06, it will be #6 because that's where that release_date is in releases. So how do I do this?