need to convert a json response body into a array-like object in an Angular 13 environment
the incoming response data looks like:
[
{
"n": 1,
"s": "s1"
},
{
"n": 2,
"s": "s2"
},
{
"n": 3,
"s": "s3"
}
]
the resulting array-like object needs to look like
{
numArray: [1,2,3],
stringArray: ['s1','s2','s3']
}
have tried using map, flatmap, toArray + others from RxJS library seem to be unable to make the list. generally end up with:
{n: 1, s: 's1'}
{n: 2, s: 's2'}
{n: 3, s: 's3'}
how to do this translation?