Search
Complete the JavaScript function to count the occurrences of characters in a given string. The function should return an array containing objects representing each character and its occurrence count.
For example: