astuanax/funmatrix

View on GitHub
src/util/generate.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * @function generate
 * @desc Generator function for a matrix array, values are set to undefined
 * @param {Number} rows
 * @param {Number} cols
 * @returns {any[][]}
 */
export default (rows, cols) => Array.apply(null, Array(rows)).map(x => Array.apply(null, Array(cols)))