I want my array to have minimum of n length.
If the number of elements is below the given length then I want it to be filled with given/default element until length is n.
It's very much like String padEnd function.
a=[1,2,3]
a.padEnd(6, null);
a;// [1,2,3,null,null,null];
my solution so far:
n = 10, value = {};
arr.concat(Array(n).fill(value, 0, n)).slice(0, n);