I am getting a json object just like below
response = [
{
'a': [
{
'b': [
{
'c': [
{
'name': 'abc',
'value': 900
}
]
}
]
}
]
},
{
'a': [
{
'b': [
{
'c': [
{
'name': 'abc',
'amount': 900
}
]
}
]
}
]
}
];
now I am looping over the object using the code below
this.response.forEach(
(event) => {
event.a.forEach(
() => {
}
);
}
)
and while compiling it I am getting an error message
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((callbackfn: (value: { 'b': { 'c': { 'name': string; 'value': number; }[]; }[]; }, index: number...' has no compatible call signatures.
Any fix for the above error?. Thanks in advance
() => { ... }in the innerforEach. Using(b) => { ... }might solve the problem.