asorted.js
function Asorted() {
  this.array = [];
  this.sortBy = (arguments[0] && arguments[0].sortBy) ? arguments[0].sortBy : false;
  var index = this.sortBy ? 1 : 0;
  var length = arguments.length;
  while (index < length) {
    this.insert(arguments[index]);
    index++;
  }
}
function Asorted() {
  this.array = [];
  this.sortBy = (arguments[0] && arguments[0].sortBy) ? arguments[0].sortBy : false;
  var index = this.sortBy ? 1 : 0;
  var length = arguments.length;
  while (index < length) {
    this.insert(arguments[index]);
    index++;
  }
}
function Asorted ( ) { this . array = [ ] ; this . sortBy = ( arguments [ 0 ] && arguments [ 0 ] . sortBy ) ? arguments [ 0 ] . sortBy : false ; var index = this . sortBy ? 1 : 0 ; var length = arguments . length ; while ( index < length ) { this . insert ( arguments [ index ] ) ; index ++ ; } }
Asorted Constructor

@param   options   object
options:
sortBy    string    the key by which to sort objects

Example
asorted = new Asorted({ sortBy: 'size'}, { name: 'Danny', size: 10 }, { name: 'Linus', size: 9 } );
asorted = new Asorted(4, 42, 8, 16, 15, 23);
Asorted Constructor