Function getDNABaseComplement

  • Given a valid DNA base string, return its complement

    Parameters

    • base: string

      The DNA base string to get the complement of

    Returns undefined | string

    A string of the complement of the given base, or undefined if the given base was invalid

    Example

     getDNABaseComplement('A'); //returns 'T'
    getDNABaseComplement('T'); //returns 'A'
    getDNABaseComplement('C'); //returns 'G'
    getDNABaseComplement('G'); //returns 'C'