Below code snippet explains how to do sorting in JQuery.
var books = [ “Adventure”,”Educational”,”Comedy”];
books = books.sort();
The output of the above code is..,
Because sorting is done in Alphabetical order in JQuery.