function cartesianSquare( x ) {
	var get;
	var out;
	var N;
	var v;
	var i;
	var j;

	get = resolveGetter( x );
	N = x.length;
	out = [];
	for ( i = 0; i < N; i++ ) {
		v = get( x, i );
		for ( j = 0; j < N; j++ ) {
			out.push( [ v, get( x, j ) ] );
		}
	}
	return out;
}
Returns the Cartesian square.

@param {Collection} x - input array
@returns {Array<Array>} list of ordered tuples comprising the Cartesian product

@example
var x = [ 1, 2 ];

var out = cartesianSquare( x );
// returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]