im new to JS and i have an problem
let dict = data.foo;
dict.hello = "world";
console.log(dict);
data.foo is {"num":["1","2"]}
results are {"num":["1","2"]}
Tried doing
let dict = data.foo;
dict["hello"] = "world";
console.log(dict);
but same output…
Excepted {"num":["1","2"], "hello":"world"}
Thanks.
New contributor
sampleOBJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1