'use strict';

// MODULES //

var isArrayArray = require( '@stdlib/utils/is-array-array' );


// MAIN //

/**
* Creates an object from an array of key-value pairs.
*
* @param {ArrayArray} entries - input object
* @throws {TypeError} must provide an array of arrays
* @returns {Array} array containing key-value pairs
*
* @example
* var entries = [ ['beep', 'boop'], ['foo', 'bar'] ];
*
* var obj = objectFromEntries( entries );
* // returns {'beep': 'boop', 'foo': 'bar'}
*/
function objectFromEntries( entries ) {
	var out;
	var i;
	if ( !isArrayArray( entries ) ) {
		throw new TypeError( 'invalid input argument. Must provide an array of arrays. Value: `'+entries+'`.' );
	}
	out = {};
	for ( i = 0; i < entries.length; i++ ) {
		out[ entries[i][0] ] = entries[ i ][ 1 ];
	}
	return out;
} // end FUNCTION objectFromEntries()


// EXPORTS //

module.exports = objectFromEntries;

@@ -274,41 +274,50 @@
 ns %7B
-Array%7D array containing key-
+Object%7D object created from %60%5Bkey, 
 value
+%5D%60
  pai

Fix return JSDoc annotation