I am working on a function that analyzes a string of DNA and should return an accurately matched DNA array. Here is the code snippet I have experimented with:
function checkDNA(dna) {
var dnaarr = [];
for(var i = 0; i < dna.length; i++) {
var str = [];
str.push(dna[i]); //adding current dna letter to str array
if(dna[i].indexOf('') === 0) {
var a = str.push('sd');
}
if(dna[i].indexOf('GGC') === 0) {
var b = str.push("GC", "GC", "CG");
}
if(dna[i].indexOf('gat') === 0) {
var c = str.push("GC", "AT", "TA");
}
if(dna[i].indexOf('PGYYYHVB') === 0) {
var d = str.push('GC');
}
dnaarr.push(str); //adding the str array to the main dnaarr array
}
return dnaarr;
}