code: function(item) {
              if (Garnish.isJquery(item)) {
                  if (!item[0]) {
                      return false;
                  }
  
                  item = item[0];
              }
  
              return ($.inArray(item, this.$selectedItems) !== -1);
          }
docs: Is Selected?