Typescript Select Ids from object [duplicate]
问题 This question already has answers here : From an array of objects, extract value of a property as array (14 answers) Closed 2 years ago . I am new to Typescript. I want to select ids from observable This is my observable let myObj = [{ "id": 1, "text": "Mary" }, { "id": 2, "text": "Nancy" }, { "id": 3, "text": "Paul" }, { "id": 4, "text": "Cheryl" }, { "id": 5, "text": "Frances" }] Expected Result : let selectedIds = [1,2,3,4,5]; Can I do this without creating an array and pushing the ids in