DNA Pairing challenge - TypeError: unknown: o is undefined - help needed

Hi guys, starting with JS and trying to really do everything on my own, hence the garbage code. It works in Visual Studio Code as intended, but FCC is throwing “TypeError: unknown: o is undefined” and for the love of God I can not figure out why. I thought I am missing { somewhere, but that does not seem to be the case. Any help is much appreciated!

`function pairElement(str) {
    var arr = [];
    while (arr.push([]) < str.length);
    var arr2 = str.split("");
    for (let i = 0; i < arr2.length; i++) {
        arr[i].splice(i, 0, arr2[i]);
    for (let j = 0; j < arr.length; j++) {
        if (arr[j] == "G") {
        } else if (arr[j] == "C") {
        } else if (arr[j] == "T") {
        } else if (arr[j] == "A") {

    return arr;


It’s that line, it should be while (arr.push([]) < str.length) {}.
That passes the test for me!

Thank you so much! so I was indeed missing {} :smiley:

1 Like