Sha256: c91c3d7af69b59917ea81ea0ad61c7ef7a878410d3177c1e9786cfd6674a19cd

Contents?: true

Size: 385 Bytes

Versions: 81

Compression:

Stored size: 385 Bytes

Contents

'use strict';

var DnaTranscriber = function(){};

var dnaToRna = {
  G: 'C',
  C: 'G',
  T: 'A',
  A: 'U'
};

var transcribeDna = function(dna, lookupTable) {
  return dna.replace(/./g, function(dnaNucleotide) {
    return lookupTable[dnaNucleotide];
  });
}

DnaTranscriber.prototype.toRna = function(dna) {
  return transcribeDna(dna, dnaToRna);
}

module.exports = DnaTranscriber;

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
trackler-2.0.6.25 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.24 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.23 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.22 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.21 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.20 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.19 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.18 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.17 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.16 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.15 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.14 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.13 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.12 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.11 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.10 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.9 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.8 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.7 tracks/javascript/exercises/rna-transcription/example.js
trackler-2.0.6.6 tracks/javascript/exercises/rna-transcription/example.js