Implement `$.prototype.index`