Zip one or more arrays.
var zip = require( '@stdlib/array/base/zip' );Zips one or more arrays.
var x = [ 1, 2 ];
var y = [ 3, 4 ];
var out = zip( [ x, y ] );
// returns [ [ 1, 3 ], [ 2, 4 ] ]The function supports the following parameters:
- arrays: list of arrays to zip.
- The function assumes that the list of arrays to be zipped all have the same length.
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var zeroTo = require( '@stdlib/array/base/zero-to' );
var zip = require( '@stdlib/array/base/zip' );
var x = zeroTo( 10 );
var y = discreteUniform( x.length, -100, 100 );
var out = zip( [ x, y ] );
// returns [...]