One LinerCreate array of n elementsCreate array of n elementsJavascriptTypescriptconst generateArray = (n) => Array(n).fill(0); Example generateArray(4); // [0, 0, 0, 0]Last Update: 05:54 - 19 April 2024PreviousCreate array from 1 to nNextMap From-To ObjectOn this page