Count Repeated Characters In Array Using Javascript