function map2d( x, shape, fcn, thisArg ) {
	var S0;
	var S1;
	var i0;
	var i1;
	var x0;
	var y0;
	var y;

	S0 = shape[ 1 ];
	S1 = shape[ 0 ];
	y = [];
	for ( i1 = 0; i1 < S1; i1++ ) {
		x0 = x[ i1 ];
		y0 = [];
		for ( i0 = 0; i0 < S0; i0++ ) {
			y0.push( fcn.call( thisArg, x0[ i0 ], [ i1, i0 ], x ) );
		}
		y.push( y0 );
	}
	return y;
}
Applies a function to elements in a two-dimensional nested input array and assigns results to elements in a new two-dimensional nested output array.

@param {ArrayLikeObject<Collection>} x - input nested array
@param {NonNegativeIntegerArray} shape - array shape
@param {Function} fcn - function to apply
@param {*} [thisArg] - function execution context
@returns {Array<Array>} output array

@example
var ones2d = require( '@stdlib/array/base/ones2d' );

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

var shape = [ 2, 2 ];

var x = ones2d( shape );
var y = map2d( x, shape, scale );
// returns [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]