How to fill in missing months of last year in an array using javascript

I have an array of months and its count as follows:

[
            {
                "registered_to_month": "04-2022",
                "count": "3"
            },
            {
                "registered_to_month": "03-2022",
                "count": "4"
            },
            {
                "registered_to_month": "02-2022",
                "count": "6"
            },
            {
                "registered_to_month": "01-2022",
                "count": "6"
            },
            {
                "registered_to_month": "11-2021",
                "count": "11"
            }
        ]

This result I am getting last 12 months The months which is not available I want to replace with 0 so that I can plot in the graph. I am not able to figure out how can I solve this.