Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

DNA Pairing solution

function pairElement(str) {
  let pairs = {
    'A' : 'T',
    'T' : 'A',
    'C' : 'G',
    'G' : 'C'
  }
  return str.toUpperCase().split('').map(letter => [letter, pairs[letter]]);
  // str.toUpperCase() in case of lowercase letters to avoid errors
}

pairElement("GCGAt");
Comment

PREVIOUS NEXT
Code Example
Javascript :: window replace url 
Javascript :: js html table extract data 
Javascript :: mui textfield font color 
Javascript :: how to update angular version 
Javascript :: new request javascript 
Javascript :: divide intagers javascript 
Javascript :: jquery change picture source 
Javascript :: set dropdown value using jquery 
Javascript :: canvas fillrect 
Javascript :: react router dom npm 
Javascript :: fuse.js cdn 
Javascript :: get response from form jquery 
Javascript :: html print div 
Javascript :: get all rooms socket.io 
Javascript :: javascript set attribute href 
Javascript :: javascript get hostname from current url 
Javascript :: img onerror 
Javascript :: js create events in for always gets last id 
Javascript :: regex exec fails twice 
Javascript :: NotYetImplemented ng2-chart angular 2 
Javascript :: javascript video after play 
Javascript :: js get first 3 characters of string 
Javascript :: javascript button onclick 
Javascript :: how to append more elements after click in react 
Javascript :: reapeat until in js 
Javascript :: adonisjs findorcreate 
Javascript :: how to round double value in js 
Javascript :: get keys objet javascript 
Javascript :: nodejs powershell process env 
Javascript :: expo android built is huge 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =