function prependSingletonDimensions( x, n ) { // eslint-disable-line id-length
	var strides;
	var shape;
	var sh;
	var st;
	var N;
	var i;

	sh = getShape( x, false );
	st = getStrides( x, false );
	N = sh.length;

	strides = [];
	shape = [];

	// Prepend singleton dimensions...
	for ( i = 0; i < n; i++ ) {
		shape.push( 1 );
		strides.push( st[ 0 ] );
	}
	// Copy remaining dimensions...
	for ( i = 0; i < N; i++ ) {
		shape.push( sh[ i ] );
		strides.push( st[ i ] );
	}
	if ( isReadOnly( x ) ) {
		// If provided a read-only view, the returned array should also be read-only...
		return new x.constructor( getDType( x ), getData( x ), shape, strides, getOffset( x ), getOrder( x ), { // eslint-disable-line max-len
			'readonly': true
		});
	}
	return new x.constructor( getDType( x ), getData( x ), shape, strides, getOffset( x ), getOrder( x ) ); // eslint-disable-line max-len
}
Returns an array with a specified number of prepended singleton dimensions.

@param {ndarray} x - input array
@param {NonNegativeInteger} n - number of singleton dimensions to prepend
@returns {ndarray} output array

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

var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
// returns <ndarray>

var shx = x.shape;
// returns [ 2, 2 ]

var y = prependSingletonDimensions( x, 3 );
// returns <ndarray>

var shy = y.shape;
// returns [ 1, 1, 1, 2, 2 ]

var v = y.get( 0, 0, 0, 0, 0 );
// returns 1

v = y.get( 0, 0, 0, 0, 1 );
// returns 2

v = y.get( 0, 0, 0, 1, 0 );
// returns 3

v = y.get( 0, 0, 0, 1, 1 );
// returns 4