I am attempting to sort data into an appropriate category of array once parsed;
First lets initialize my Array like so.
const foo = {
bar: {},
bar2: {}
}
I am unable to utilize the .push prototype on the subarray build, for example.
foo.bar.push('foobar');
The error I will receive is
TypeError: Cannot read property 'push' of undefined
The array has been initialized using the first block of code.
I have also attempted to use the following and receive the same response from the console.
foo[0].push('foobar');
How could one push data to a subarray?
BONUS POINTS/PS. What is this kind of array called? Is this a subarray or multidimensional array or neither?
Thanks in advance.
What is this kind of array called?which kind?{}is an Object{}=new Object()and[]=new Array()