Back to examples

About

In this example, you can sort movies on different parameters: Title, Showtime and Rating

From the console

You can access the movies from the console with:

movies;

Or, create new movies instances:

var moviesByShowtime = new Movies(raw);

You can then call the sort functions, and output the state of the collection with:

movies.log();

First, you can compute a new order with

movies.sortByTitle();

To set the new order, combine the sort with a reset:

movies.reset(movies.sortByTitle());

To sort by Showtime, you can try:

movies.reset(movies.sortByShowtime())

From a UI

The same collection can be sorted with a UI