Nucleotide Count in JavaScript