Created
November 18, 2018 16:59
-
-
Save felipebhz/bb4d244b316101126b3cd9bca08fe4d0 to your computer and use it in GitHub Desktop.
Contar Sequência de DNA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let arrDNA = ['A','G','C','T','T','T','T','C','A','T','T','C','T','G','A','C','T','G','C','A','A','C','G','G','G','C','A','A','T','A','T','G','T','C','T','C','T','G','T','G','T','G','G','A','T','T','A','A','A','A','A','A','A','G','A','G','T','G','T','C','T','G','A','T','A','G','C','A','G','C'] | |
let letraA = 0; | |
let letraG = 0; | |
let letraC = 0; | |
let letraT = 0; | |
for(i=0;i<=arrDNA.length;i++){ | |
switch(arrDNA[i]){ | |
case "A": | |
letraA++; | |
break; | |
case "G": | |
letraG++; | |
break; | |
case "C": | |
letraC++ | |
break; | |
case "T": | |
letraT++; | |
break | |
default: | |
} | |
} | |
console.log("A:",letraA); | |
console.log("G:",letraG); | |
console.log("C:",letraC); | |
console.log("T:",letraT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment