How To Count Frequency In Js