DNA Pairing Challenge - using ForEach -- answered, delete

DNA Pairing Challenge - using ForEach -- answered, delete
0
#1

Ignore!! Found the solution after a while and waiting for a moderator to delete this.

Tell us what’s happening:
I don’t understand why this solution does not work. Trying to console.log(newArr) after forEarch has been executed is returning null. What am I missing?

Your code so far

function pairElement(str) {
  let pairing = {
  "A": "T",
  "T": "A",
  "C": "G",
  "G": "A"
  }

  let arr = str.split("");
  let newArr = [];
  arr.forEach(function(element){
    newArr.push([element, pairing[element]]);
  }
  );

  return newArr;
}

pairElement("ATCGA");

Link to challenge:
I can’t post links yet, so here is the slug: intermediate-algorithm-scripting/dna-pairing

#2

Found the solution. It was a simple mistake not worth a post. Can someone show me where the flag option is so I can alert the moderator to delete?

#3

You can find more options from the three dots below your post, near the edit symbol

#4

I tried that. I get a prompt saying “You don’t have permission to delete this topic. If you really want it to be deleted, submit a flag for moderator attention together with reasoning.” Haven’t figured out how to flag yet! :frowning:

#5

There is a flag button there too

image

#6

This entry was very nice

#7

I don’t see the flag icon. I think my account may not have that privilege yet?

#8

Hi, what was the issue?

#9

There was a typo

If you need help with your code post it and someone will give you some hints!