Create an object from a provided list of properties and a provided list of corresponding values.
var zip2object = require( '@stdlib/array/base/zip2object' );Returns an object from a provided list of properties and a provided list of corresponding values.
var properties = [ 'a', 'b' ];
var values = [ 1, 2 ];
var out = zip2object( properties, values );
// returns { 'a': 1, 'b': 2 }The function supports the following parameters:
- properties: list of properties.
- values: list of values.
- The function assumes that both input arrays have the same length.
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var zeroTo = require( '@stdlib/array/base/zero-to' );
var zip2object = require( '@stdlib/array/base/zip2object' );
var x1 = zeroTo( 10 );
var x2 = discreteUniform( x1.length, -100, 100 );
var out = zip2object( x1, x2 );
// returns {...}