tracks/javascript/exercises/rna-transcription/example.js in trackler-2.0.6.25 vs tracks/javascript/exercises/rna-transcription/example.js in trackler-2.0.6.26
- old
+ new
@@ -9,9 +9,10 @@
A: 'U'
};
var transcribeDna = function(dna, lookupTable) {
return dna.replace(/./g, function(dnaNucleotide) {
+ if (!(dnaNucleotide in lookupTable)) { throw Error('Invalid input'); }
return lookupTable[dnaNucleotide];
});
}
DnaTranscriber.prototype.toRna = function(dna) {