Array object only displaying final data for each index in JavaScript
I'm creating an array of objects in Javascript. The object data is being generated on the fly in a for loop. When you run this code you'll see that the final array generated in the console log is all the…