function forEach( arrays, fcn, thisArg ) {
	var ndims;
	var shx;
	var x;

	// Unpack the ndarray and standardize ndarray meta data:
	x = ndarray2object( arrays[ 0 ] );
	shx = x.shape;
	ndims = shx.length;

	// Determine whether we can avoid iteration altogether...
	if ( ndims === 0 ) {
		if ( x.accessorProtocol ) {
			return ACCESSOR_FOR_EACH[ ndims ]( x, fcn, thisArg );
		}
		return FOR_EACH[ ndims ]( x, fcn, thisArg );
	}
	// Check whether we were provided an empty ndarray...
	if ( numel( shx ) === 0 ) {
		return;
	}
	// Determine whether we can avoid blocked iteration...
	if ( ndims <= MAX_DIMS && iterationOrder( x.strides ) !== 0 ) {
		// So long as iteration always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...
		if ( x.accessorProtocol ) {
			return ACCESSOR_FOR_EACH[ ndims ]( x, fcn, thisArg );
		}
		return FOR_EACH[ ndims ]( x, fcn, thisArg );
	}
	// Determine whether we can perform blocked iteration...
	if ( ndims <= MAX_DIMS ) {
		if ( x.accessorProtocol ) {
			return BLOCKED_ACCESSOR_FOR_EACH[ ndims-2 ]( x, fcn, thisArg );
		}
		return BLOCKED_FOR_EACH[ ndims-2 ]( x, fcn, thisArg );
	}
	// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...
	if ( x.accessorProtocol ) {
		return accessorForEachnd( x, fcn, thisArg );
	}
	forEachnd( x, fcn, thisArg );
}
Invokes a callback function once for each ndarray element.

## Notes

-   A provided ndarray should be an `object` with the following properties:

    -   **dtype**: data type.
    -   **data**: data buffer.
    -   **shape**: dimensions.
    -   **strides**: stride lengths.
    -   **offset**: index offset.
    -   **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).

@param {ArrayLikeObject<Object>} arrays - array-like object containing one input array
@param {Callback} fcn - callback function
@param {*} [thisArg] - callback function execution context
@returns {void}

@example
var Float64Array = require( '@stdlib/array/float64' );
var naryFunction = require( '@stdlib/utils/nary-function' );
var log = require( '@stdlib/console/log' );

// Create a data buffer:
var xbuf = new Float64Array( 12 );

// Define the shape of the array:
var shape = [ 3, 1, 2 ];

// Define the array strides:
var sx = [ 4, 4, 1 ];

// Define the index offset:
var ox = 1;

// Create an ndarray-like object:
var x = {
    'ref': null,
    'dtype': 'float64',
    'data': xbuf,
    'shape': shape,
    'strides': sx,
    'offset': ox,
    'order': 'row-major'
};

// Apply the callback function:
forEach( [ x ], naryFunction( log, 1 ) );