Ad
  • Custom User Avatar

    When specifying what to replace in the replace method - why does /./g work? Wouldn't that break if there was a "." in the string? My solution had /[ATCG]/g as the "what to replace" and it also worked, but I cannot find the meaning of /./g anywhere online. I am slightly confused as to whether or not this is a best practice - or if it simply worked in this instance since there are no "." symbols in the string that is being replaced.

  • Custom User Avatar

    When specifying what to replace in the replace method - why does /./g work? Wouldn't that break if there was a "." in the string? My solution had /[ATCG]/g as the "what to replace" and it also worked, but I cannot find the meaning of /./g anywhere online. I am slightly confused as to whether or not this is a best practice - or if it simply worked in this instance since there are no "." symbols in the string that is being replaced.

  • Custom User Avatar

    When specifying what to replace in the replace method - why does /./g work? Wouldn't that break if there was a "." in the string? My solution had /[ATCG]/g as the "what to replace" and it also worked, but I cannot find the meaning of /./g anywhere online. I am slightly confused as to whether or not this is a best practice - or if it simply worked in this instance since there are no "." symbols in the string that is being replaced.

  • Custom User Avatar

    When specifying what to replace in the replace method - why does /./g work? Wouldn't that break if there was a "." in the string? My solution had /[ATCG]/g as the "what to replace" and it also worked, but I cannot find the meaning of /./g anywhere online. I am slightly confused as to whether or not this is a best practice - or if it simply worked in this instance since there are no "." symbols in the string that is being replaced.