function numel( shape ) {
	var ndims;
	var n;
	var i;

	ndims = shape.length;
	if ( ndims === 0 ) {
		return 0;
	}
	n = 1;
	for ( i = 0; i < ndims; i++ ) {
		n *= shape[ i ];
	}
	return n;
}
Returns the number of elements in an array.

@param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape
@returns {NonNegativeInteger} number of elements

@example
var n = numel( [ 3, 3, 3 ] );
// returns 27