function forEach( x, fcn, thisArg ) {
	if ( !isndarrayLike( x ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
	}
	if ( !isFunction( fcn ) ) {
		throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', fcn ) );
	}
	base( [ x ], fcn, thisArg );
}
Invokes a callback function once for each ndarray element.

@param {ndarray} x - input ndarray
@param {Callback} fcn - callback function
@param {*} [thisArg] - callback execution context
@throws {TypeError} first argument must be an ndarray-like object
@throws {TypeError} callback argument must be a function
@returns {void}

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

var buffer = 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 shape = [ 2, 3 ];
var strides = [ 6, 1 ];
var offset = 1;

var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
// returns <ndarray>

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