I have been stuck on this for a while. I have an array of object where the key is the same for all of the objects (see below). I am trying to extract the data from the first object in the array [0]. However when I console.log the data I get 'Cannot read property '0' of undefined. Here is the image of the data that I receive when I just filter the data.
And here is the code that I am using to get that data:
const handleClick = e => {
e.preventDefault();
const buttonValue = e.target.value;
console.log(buttonValue);
grid.on('rowClick', (...args) =>
args.filter(data => {
data.cells;
console.log(data.cells);
})
);
};
when I add an index of 0 to the console.log console.log(data.cells[0]);
I get the cannot read property 0 of undefined