@technobuddha/library
Version:
A large library of useful functions
12 lines (11 loc) • 441 B
TypeScript
/**
* Create a two dimensional array with all elements initialized
*
* @remark Array is accessed by array[w][h]
*
* @param width Width of the array
* @param height Height of the array
* @param fill value to fill the array, or a function returning the fill value for each element
*/
export declare function create2DArray<T>(width: number, height: number, fill: T | ((x: number, y: number) => T)): T[][];
export default create2DArray;