function map( arrays, fcn, thisArg ) {
	var ndims;
	var shx;
	var shy;
	var iox;
	var ioy;
	var len;
	var ord;
	var x;
	var y;
	var i;
	var d;

	// Unpack the ndarrays and standardize ndarray meta data:
	x = ndarray2object( arrays[ 0 ] );
	y = ndarray2object( arrays[ 1 ] );

	// Verify that the input and output arrays have the same number of dimensions...
	shx = x.shape;
	shy = y.shape;
	ndims = shx.length;
	if ( ndims !== shy.length ) {
		throw new Error( format( 'invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == %d. ndims(y) == %d.', ndims, shy.length ) );
	}
	// Determine whether we can avoid iteration altogether...
	if ( ndims === 0 ) {
		if ( x.accessorProtocol || y.accessorProtocol ) {
			return ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg );
		}
		return MAP[ ndims ]( x, y, fcn, thisArg );
	}
	// Verify that the input and output arrays have the same dimensions...
	len = 1; // number of elements
	for ( i = 0; i < ndims; i++ ) {
		d = shx[ i ];
		if ( d !== shy[ i ] ) {
			throw new Error( 'invalid arguments. Arrays must have the same shape.' );
		}
		// Note that, if one of the dimensions is `0`, the length will be `0`...
		len *= d;
	}
	// Check whether we were provided empty ndarrays...
	if ( len === 0 ) {
		return;
	}
	// Determine whether the ndarrays are one-dimensional and thus readily translate to one-dimensional strided arrays...
	if ( ndims === 1 ) {
		if ( x.accessorProtocol || y.accessorProtocol ) {
			return ACCESSOR_MAP[ ndims ]( x, y, fcn, thisArg );
		}
		return MAP[ ndims ]( x, y, fcn, thisArg );
	}
	// Determine iteration order:
	iox = iterationOrder( x.strides ); // +/-1
	ioy = iterationOrder( y.strides ); // +/-1

	// Determine whether we can avoid blocked iteration...
	ord = strides2order( x.strides );
	if ( iox !== 0 && ioy !== 0 && ord === strides2order( y.strides ) ) {
		// Determine whether we can use simple nested loops...
		if ( ndims <= MAX_DIMS ) {
			// So long as iteration for each respective array 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 || y.accessorProtocol ) {
				return ACCESSOR_MAP[ ndims ]( x, y, ord === 1, fcn, thisArg );
			}
			return MAP[ ndims ]( x, y, ord === 1, fcn, thisArg );
		}
		// Fall-through to blocked iteration...
	}
	// Determine whether we can perform blocked iteration...
	if ( ndims <= MAX_DIMS ) {
		if ( x.accessorProtocol || y.accessorProtocol ) {
			return BLOCKED_ACCESSOR_MAP[ ndims-2 ]( x, y, fcn, thisArg );
		}
		return BLOCKED_MAP[ ndims-2 ]( x, y, 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 || y.accessorProtocol ) {
		return accessormapnd( x, y, fcn, thisArg );
	}
	mapnd( x, y, fcn, thisArg );
}
Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.

## Notes

-   Each 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 and one output array
@param {Callback} fcn - callback function
@param {*} [thisArg] - callback execution context
@throws {Error} arrays must have the same number of dimensions
@throws {Error} arrays must have the same shape
@returns {void}

@example
var Float64Array = require( '@stdlib/array/float64' );

function scale( z ) {
    return z * 10.0;
}

// Create data buffers:
var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
var ybuf = new Float64Array( 6 );

// Define the shape of the input and output arrays:
var shape = [ 3, 1, 2 ];

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

// Define the index offsets:
var ox = 1;
var oy = 0;

// Create the input and output ndarray-like objects:
var x = {
    'dtype': 'float64',
    'data': xbuf,
    'shape': shape,
    'strides': sx,
    'offset': ox,
    'order': 'row-major'
};
var y = {
    'dtype': 'float64',
    'data': ybuf,
    'shape': shape,
    'strides': sy,
    'offset': oy,
    'order': 'row-major'
};

// Apply function:
map( [ x, y ], scale );

console.log( y.data );
// => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]