I was toying a bit and was trying to instantiate a new array of length x, where all elements of that array were initialized to a value y:
x
y
You could also solve this by the following workaround.
var arr = new Array(2).fill({}); arr = JSON.parse(JSON.stringify(arr));