DNA and RNA are sequences of nucleotides.
Four nucleotides in DNA are adenine (A), cytosine (C), guanine (G) and thymine (T).
Four nucleotides in RNA are adenine (A), cytosine (C), guanine (G) и uracil (U).
RNA is constructed based on the DNA sequence by replacing each nucleotide as follows:
Implement and export a function as default that takes a DNA string and returns the corresponding RNA string.
If the parameter includes no nucleotides (in other words, an empty string is passed), then the function should return an empty string.
If the incoming DNA includes an "unknown" nucleotide, the function should 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, the opportunity to seek help from mentors and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.