I want to make array object like this:
{'book1':3, 'book2':4, 'book3':5}
from an array like this
['book1', 'book1', 'book1', 'book2', 'book2', 'book2',
'book2', 'book3', 'book3', 'book3', 'book3', 'book3']
How to do that? my idea is looping, but dont know to count the same value
*sorry for bad explanation