I am trying to create a multi dimensional array programmatically. But when i push an object into the array it gets pushed into all indexes in the array. Why is this happening
Here's a simple demo
let postTest = new Array(4).fill([]);
postTest[0].push({key: 'value', anotherKey: 'value'});
console.log(postTest);