DNA and RNA are nucleotide sequences.
The four nucleotides in DNA are adenine (A), cytosine (C), guanine (G), and thymine (T).
The four nucleotides in RNA are adenine (A), cytosine (C), guanine (G), and uracil (U).
The RNA strand is made up of the DNA strand by sequentially replacing each nucleotide:
Implement and export as default a function that takes a DNA strand and returns the corresponding RNA strand (performs RNA transcription).
If the input parameter does not contain a single nucleotide (i.e. an empty string is passed in), the function should return an empty string. If an "unknown" nucleotide (not one of the four listed above) is found, the function must return
dnaToRna('ACGTGGTCTTAA'); // 'UGCACCAGAAUU' dnaToRna('CCGTA'); // 'GGCAU' dnaToRna(''); // '' dnaToRna('ACNTG'); // null
For full access to the challenge you need a professional subscription.
A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.