.remove(index)
.remove(index)
for a couple of reasons I had to implement double checks over .index(el) plus remove mehtod ... I wonder if something like this could be useful:
<span style="font-family: courier new,monospace;">remove: function( selector ) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> // proposal - start</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if(typeof selector == "number" && this[selector])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $(Array.prototype.splice.call(this, selector, 1)).remove();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> else
// proposal - end</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if ( !selector || jQuery.filter( selector, [ this ] ).length ) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> // Prevent memory leaks</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if ( this.nodeType === 1 ) { </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> cleanData( this.getElementsByTagName("*") ); </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> cleanData( [this] ); </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if (this.parentNode)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> this.parentNode.removeChild( this );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> },</span>
which in my case would have saved some time.
Regards