function removeAt( x, index ) {
	var len;
	var i;
	var j;

	len = x.length;
	if ( index < 0 ) {
		index += len;
		if ( index < 0 ) {
			return x;
		}
	} else if ( index >= len ) {
		return x;
	}
	j = index;
	for ( i = index+1; i < len; i++ ) {
		x[ j ] = x[ i ];
		j += 1;
	}
	x.length = j;
	return x;
}
Removes an element from an array.

@param {Array} x - input array
@param {integer} index - element index
@returns {Array} mutated input array

@example
var x = [ 1, 1, 2, 3, 3 ];

var y = removeAt( x, -3 );
// returns [ 1, 1, 3, 3 ]

var bool = ( x === y );
// returns true