create empty array with length javascript fill it with 1 to n code example Example: how can I create an empty array fill with 0 in javascript? new Array(len).fill(0);