// var // Comparable;

// (function($) { // “use strict”;

// // callback pode ser definido aqui (static) para ser usado no caso de o tipo dos dois argumentos forem de um tipo incompatível

// $.extend({

// Comparable: {

// compareTo: function (object) { // if (this) { // if (Object.getPrototypeOf(this) == // Object.getPrototypeOf(object) && // this > object) { // return true; // } // } else if (argument) { // if (Object.getPrototypeOf(object) == // Object.getPrototypeOf(argument) && // object > argument) { // return true; // } // } // }

// // compareTo: function (callback) { // // var // // clone, // // collection;

// // // não precisa testar se é instância de array, bastaria testar se é iterável e usar Array.from para converter // // if (this && this instanceof Array) { // // collection = this; // // } else if (callback instanceof Array && argument && // // typeof argument == “function”) { // // collection = callback; // // callback = argument; // // }

// // clone = collection.clone(); // // clone.sort(function(a, b) { // // // return callback(a, b); // // callback(a, b); // // }); // // }

// }

// });

// }(window));