Error trying to assignment objects in javascript
let info = {
ID: '',
}
let ids = ["0", "1", "2", "3", "4"]
ids.forEach((i) => {
info.ID = i
console.log(info)
});
I expect the output of this code to be an object info with ID 1 to 4, but the actual output is info.ID = 4