Convert array of number and object into array of number

I have an array in my Angular class containing number and object as shown below.

What I want to do is recreate the array with only number like so [5,8,9,1,7] i.e. I get the id of the object inside the array and append it to the array.

allowedDepartmentAccess = [
    5,
    8,
    9,
    {
        "id": 1,
        "name": "Human Resource",
        "abbreviation": "HR"
    },
    {
        "id": 7,
        "name": "Warehouse",
        "abbreviation": "WH"
    }
]