function recurse( x, y, ndims, shape, dim, fcn ) {
	var S;
	var d;
	var i;

	S = shape[ dim ];

	// Check whether we've reached the innermost dimension:
	d = dim + 1;

	if ( d === ndims ) {
		// Apply the provided callback...
		for ( i = 0; i < S; i++ ) {
			y[ i ] = fcn( x[ i ] );
		}
		return;
	}
	// Continue recursing into the nested arrays...
	for ( i = 0; i < S; i++ ) {
		recurse( x[ i ], y[ i ], ndims, shape, d, fcn );
	}
}
Recursively applies a unary callback.

@private
@param {ArrayLikeObject} x - input array
@param {ArrayLikeObject} y - output array
@param {NonNegativeInteger} ndims - number of dimensions
@param {NonNegativeIntegerArray} shape - array shape
@param {NonNegativeInteger} dim - dimension index
@param {Callback} fcn - unary callback
@returns {void}