Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sortAsc(x, y) {
- if (question2 == "up") {
- if (question1 == "name") {
- var ayy = x.name.toLowerCase();
- var byy = y.name.toLowerCase();
- if (ayy < byy) {
- return -1;
- }
- if (ayy > byy) {
- return 1;
- }
- return 0;
- } else {
- return x.itemsBought - y.itemsBought;
- }
- }
- }
- function sortDesc(x, y) {
- return -1 * sortAsc(x, y);
- }
Add Comment
Please, Sign In to add comment