var arr = Array(3).fill({}) // [{}, {}, {}];
arr[0].hi = "hi"; // [{ hi: "hi" }, { hi: "hi" }, { hi: "hi" }]
it can be understood that the first line of the function fill (), populating array elements fills an array of three elements with empty objects.
the second line assigns the first element {hi: "hi"}
Why does the array end up with all elements {hi: "hi"}?