Why myObj not recognized from new object.
I just want my object get myValue as key how can I implement it?
my object
let myObj = {
0: 'adi',
1: 'itzik'
}
const myValue=4;
myObj = { ...myObj, ...{ myValue: 'dani' } };
after code above
my object
let myObj = {
0: 'adi',
1: 'itzik',
myValue: 'dani' // should be 4:4
}