Skip to content

Commit

Permalink
Ejercicio 4
Browse files Browse the repository at this point in the history
  • Loading branch information
raulBric committed Mar 6, 2024
1 parent 8a4eeea commit 6e76fa5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/films.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ function moviesAverageOfDirector(array, director) {

// Exercise 4: Alphabetic order by title
function orderAlphabetically(array) {

}
let copiedMovies = [...array]
return copiedMovies
.sort((a, b) => a.title.localeCompare(b.title))
.slice(0, 20)
.map(array => array.title);
}

// Exercise 5: Order by year, ascending
function orderByYear() {
Expand Down

0 comments on commit 6e76fa5

Please sign in to comment.