function nextCartesianIndex( shape, order, idx, dim ) {
	return assign( shape, order, idx, dim, zeros( shape.length ) );
}
Returns the next Cartesian index (i.e., set of subscripts/dimension indices).

## Notes

-   The function does not check whether the current index is the "last" index. Instead, if the function is provided dimension indices corresponding to the last element, the function will cycle back to the "first" index.

@param {NonNegativeIntegerArray} shape - array shape
@param {string} order - index iteration order
@param {NonNegativeIntegerArray} idx - current dimension indices
@param {integer} dim - index of the dimension from which to start incrementing (inclusive)
@returns {(NonNegativeIntegerArray|null)} updated dimension indices

@example
var shape = [ 12 ];
var idx = nextCartesianIndex( shape, 'row-major', [ 2 ], 0 );
// returns [ 3 ]

@example
var shape = [ 2, 2, 2 ];

var idx = nextCartesianIndex( shape, 'row-major', [ 0, 0, 1 ], -1 );
// returns [ 0, 1, 0 ]

idx = nextCartesianIndex( shape, 'row-major', idx, -1 );
// returns [ 0, 1, 1 ]

idx = nextCartesianIndex( shape, 'row-major', idx, -1 );
// returns [ 1, 0, 0 ]

idx = nextCartesianIndex( shape, 'row-major', idx, -1 );
// returns [ 1, 0, 1 ]

idx = nextCartesianIndex( shape, 'row-major', idx, -1 );
// returns [ 1, 1, 0 ]

idx = nextCartesianIndex( shape, 'row-major', idx, -1 );
// returns [ 1, 1, 1 ]

@example
var shape = [];
var idx = nextCartesianIndex( shape, 'row-major', [], 0 );
// returns null

@example
var shape = [ 12 ];
var idx = nextCartesianIndex( shape, 'row-major', [ 2 ], -10 );
// returns null

@example
var shape = [ 12 ];
var idx = nextCartesianIndex( shape, 'column-major', [ 2 ], 10 );
// returns null