I'm a newcomer to Typescript and I'm looking to extract ids from an observable
Here's the observable data:
let myObj = [{
"id": 1,
"text": "Mary"
}, {
"id": 2,
"text": "Nancy"
}, {
"id": 3,
"text": "Paul"
}, {
"id": 4,
"text": "Cheryl"
}, {
"id": 5,
"text": "Frances"
}]
Desired Outcome :
let selectedIds = [1,2,3,4,5];
Is there a way to achieve this without manually creating an array and looping through the data?