reduce array of numbers into object with key and value amount [duplicate]

I have an array of numbers const array = [1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5];

I’m trying to return an object like this {
‘1’: 1,
‘2’: 1,
‘3’: 2,
‘4’: 3,
‘5’: 4
}

This is a code I’m use for now but it did’n calcutale values.
I’ve tried to google but i didn’t find how to solve it.
Please help

const array = [1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5];
const convertArrayToObject = (array) =>
array.reduce((acc, curr) => ({
...acc, [curr] : curr
}), {});