title: In this Javascript exercism, do I need to explicitly export the function definitions?
body: <p>This is my Javascript solution to rna-transcription exercism exercise:</p>
  
  <pre><code>var nucleoMap = {
    'C': 'G',
    'G': 'C',
    'A': 'U',
    'T': 'A'
  }
  
  var invertConverter = function (obj) {
    var new_obj = {};
  
    for (var prop in obj) {
      if(obj.hasOwnProperty(prop)) {
        new_obj[obj[prop]] = prop;
      }
    }
  
    return new_obj;
  };
  
  var splitStrandToArray = function(strand) {
    return strand.split('')
  }
  
  module.exports = function() {
    this.toRna = function(strand) {
      var strandArray = splitStrandToArray(strand)
      var converted = ''
  
      strandArray.forEach(function(letter) {
        converted = converted + nucleoMap[letter]
      })
  
      return converted;
    }
  
    this.toDna = function(strand) {
      var strandArray = splitStrandToArray(strand);
      var converted = ''
  
      strandArray.forEach(function(letter) {
        converted = converted + invertConverter(nucleoMap)[letter]
      })
  
      return converted;
    }
  }
  </code></pre>
  
  <p>I am only exporting an anonymous function. This anonymous function refers to function definitions that I created earlier. Do these defined functions not have to be exported even though the exported function uses these defined functions?</p>
  
  <p>This is my test that uses the exported function.</p>
  
  <p>Also, require and export aren't native to JS right? Is this exercise using some kind of node-like syntax?</p>
  
  <pre><code>var DnaTranscriber = require('./rna-transcription');
  var dnaTranscriber = new DnaTranscriber();
  
  describe('toRna()', function() {
  
    it('transcribes cytosine to guanine', function() {
      expect(dnaTranscriber.toRna('C')).toEqual('G');
    });
  
    it('transcribes guanine to cytosine', function() {
      expect(dnaTranscriber.toRna('G')).toEqual('C');
    });
  
    it('transcribes adenine to uracil', function() {
      expect(dnaTranscriber.toRna('A')).toEqual('U');
    });
  
    it('transcribes thymine to adenine', function() {
      expect(dnaTranscriber.toRna('T')).toEqual('A');
    });
  
    it('transcribes all dna nucleotides to their rna complements', function() {
      expect(dnaTranscriber.toRna('ACGTGGTCTTAA'))
          .toEqual('UGCACCAGAAUU');
    });
  });
  
  describe('toDna()', function() {
    it('transcribes cytosine to guanine', function() {
      expect(dnaTranscriber.toDna('C')).toEqual('G');
    });
  
    it('transcribes guanine to cytosine', function() {
      expect(dnaTranscriber.toDna('G')).toEqual('C');
    });
  
    it('transcribes adenine to uracil', function() {
      expect(dnaTranscriber.toDna('U')).toEqual('A');
    });
  
    it('transcribes thymine to adenine', function() {
      expect(dnaTranscriber.toDna('A')).toEqual('T');
    });
  
    it('transcribes all dna nucleotides to their rna complements', function() {
      expect(dnaTranscriber.toDna('UGAACCCGACAUG'))
          .toEqual('ACTTGGGCTGTAC');
    });
  });
  </code></pre>