I web API call and in the background, it's running more than one time. So I received the response commentRows as data which I mention.
I have to map those data into another array.
var arrPush =[ ];
var commentRows ={
'@odata.context':'https:indexes',
value:[
{
"key":"176611",
"status":true,
"errorMessage":null,
"statusCode":200
},
{
"key":"176100",
"status":true,
"errorMessage":null,
"statusCode":200
}
]
};
arrPush.push(commentRows.value);
It generates the array for as,
[
[
{
"key":"176611",
"status":true,
"errorMessage":null,
"statusCode":200
},
{
"key":"176100",
"status":true,
"errorMessage":null,
"statusCode":200
}
]
]
Needed
[
{
"key":"176611",
"status":true,
"errorMessage":null,
"statusCode":200
},
{
"key":"176100",
"status":true,
"errorMessage":null,
"statusCode":200
}
]
but I don't want the first [] has to be appended Can I use any Lodash for achieving this
arrPush.push(commentRows.value[0]);Do not use lodash for this