Tell us what’s happening:
What else do i need to do here?
Your code so far
function pairElement(str) {
var arr = str.split("");
console.log(arr);
var newArr = [];
for (i = 0; i < arr.length; i++) {
arr.forEach(function(item) {
newArr.push([item[i], item[i+1]]);
})
return newArr;
}
}
pairElement("GCG");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/dna-pairing