bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js
function(arrayOrObjectArray) {
			
			return arrayOrObjectArray.reduce(function(prev, curr) {
				var returnValue = prev;
				var filteredArray = null;
				
				if (curr && Array.isArray(curr)) {
					filteredArray = curr.filter(function(element){
						return element; //filter out falsy elements
					});	
				}
				
				// add current proposal array to flattened array
				// skip current elements that are not arrays
				if (filteredArray && Array.isArray(filteredArray) && (filteredArray.length > 0)) {
					var first = filteredArray;
					var last = prev;
					var filteredArrayStyle = filteredArray[0].style;
					
					if (filteredArrayStyle && STYLES[filteredArrayStyle] && (0 === STYLES[filteredArrayStyle].indexOf(STYLES.noemphasis))) {
						// the style of the first element starts with noemphasis
						// add these proposals to the end of the array
						first = prev;
						last = filteredArray;
					}
					
					if (first.length > 0) {
						var firstArrayStyle = first[first.length - 1].style;
						if (firstArrayStyle && (STYLES.hr !== STYLES[firstArrayStyle])) {
							// add separator between proposals from different providers 
							// if the previous array didn't already end with a separator
							first = first.concat({
								proposal: '',
								name: '',
								description: '---------------------------------', //$NON-NLS-0$
								style: 'hr', //$NON-NLS-0$
								unselectable: true
							});
						}
					}
					
					returnValue = first.concat(last);
				}
				
				return returnValue;
			}, []);
		}
function(arrayOrObjectArray) {
			
			return arrayOrObjectArray.reduce(function(prev, curr) {
				var returnValue = prev;
				var filteredArray = null;
				
				if (curr && Array.isArray(curr)) {
					filteredArray = curr.filter(function(element){
						return element; //filter out falsy elements
					});	
				}
				
				// add current proposal array to flattened array
				// skip current elements that are not arrays
				if (filteredArray && Array.isArray(filteredArray) && (filteredArray.length > 0)) {
					var first = filteredArray;
					var last = prev;
					var filteredArrayStyle = filteredArray[0].style;
					
					if (filteredArrayStyle && STYLES[filteredArrayStyle] && (0 === STYLES[filteredArrayStyle].indexOf(STYLES.noemphasis))) {
						// the style of the first element starts with noemphasis
						// add these proposals to the end of the array
						first = prev;
						last = filteredArray;
					}
					
					if (first.length > 0) {
						var firstArrayStyle = first[first.length - 1].style;
						if (firstArrayStyle && (STYLES.hr !== STYLES[firstArrayStyle])) {
							// add separator between proposals from different providers 
							// if the previous array didn't already end with a separator
							first = first.concat({
								proposal: '',
								name: '',
								description: '---------------------------------', //$NON-NLS-0$
								style: 'hr', //$NON-NLS-0$
								unselectable: true
							});
						}
					}
					
					returnValue = first.concat(last);
				}
				
				return returnValue;
			}, []);
		}
function ( arrayOrObjectArray ) { return arrayOrObjectArray . reduce ( function ( prev , curr ) { var returnValue = prev ; var filteredArray = null ; if ( curr && Array . isArray ( curr ) ) { filteredArray = curr . filter ( function ( element ) { return element ; //filter out falsy elements
 } ) ; } // add current proposal array to flattened array
 // skip current elements that are not arrays
 if ( filteredArray && Array . isArray ( filteredArray ) && ( filteredArray . length > 0 ) ) { var first = filteredArray ; var last = prev ; var filteredArrayStyle = filteredArray [ 0 ] . style ; if ( filteredArrayStyle && STYLES [ filteredArrayStyle ] && ( 0 === STYLES [ filteredArrayStyle ] . indexOf ( STYLES . noemphasis ) ) ) { // the style of the first element starts with noemphasis
 // add these proposals to the end of the array
 first = prev ; last = filteredArray ; } if ( first . length > 0 ) { var firstArrayStyle = first [ first . length - 1 ] . style ; if ( firstArrayStyle && ( STYLES . hr !== STYLES [ firstArrayStyle ] ) ) { // add separator between proposals from different providers 
 // if the previous array didn't already end with a separator
 first = first . concat ( { proposal : '' , name : '' , description : '---------------------------------' , //$NON-NLS-0$
 style : 'hr' , //$NON-NLS-0$
 unselectable : true } ) ; } } returnValue = first . concat ( last ) ; } return returnValue ; } , [ ] ) ; }
Flattens an array of arrays into a one-dimensional array.
@param {Array[]} array
@returns {Array}
Flattens an array of arrays into a one - dimensional array .