Can somebody explain please how this code works under the hood:
let arr = Array(3).fill({}) // [{}, {}, {}]
arr[0].hi = "hi" // [{ hi: "hi" }, { hi: "hi" }, { hi: "hi" }]
Why does this reference all elements? And how would I reference only the first one?