I’m struggling with a big JSON Object and I got into a weird problem:
My Object has the following structure:
const bar = {
arr: []
}
If I try to set its value in this way bar.arr.foo = 'ciao'
it doesn’t give me any error. The result object is this
What is that strange “Array(0)” that the Chrome dev tools are pointing out? If I try to type typeof bar.arr
it says “object”
But doing JSON.stringify(bar, null, 2)
results in '{n "arr": []n}'