Declaration and initialization of counter array
let counter = new Array ( MAX ) ; for ( let i = 0 ; i < MAX ; i ++ ) counter [ i ] = 0 ; for ( let i = 0 ; i < l / 2 ; i ++ ) counter [ str [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ++ ; for ( let i = Math . floor ( l / 2 ) ; i < l ; i ++ ) counter [ str [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] -- ; for ( let i = 0 ; i < MAX ; i ++ ) if ( counter [ i ] != 0 ) return true ; return false ; }