I get right answers on Codepen, but FreeCodeCamp doesn't let me submit this assignment

Tell us what’s happening:

I was trying to submit my solution of this assignment but for some reasons it doesn’t let me. When test cases are run on FreeCodeCamp they all come out as not resolved, however when I tested my code on CodePen it all worked well and gave me correct answers. I wonder why could this be happening?

Your code so far

function largestOfFour(arr) {
  let largestNumsArr = [];
  for (let i=0; i < arr.length; i++) {
    currArr = arr[i];
    largestNumInArr = -1000000;
    for (let j=0; j < currArr.length; j++) {
      if (currArr[j] > largestNumInArr) {
        largestNumInArr = currArr[j];
  return largestNumsArr;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36.

Challenge: Return Largest Numbers in Arrays

Link to the challenge:

What browser are you using?

I’m using Google Chrome

Make sure you always declare your variables. You currently have two undeclared variables which you are using in your code.

1 Like

I have declared those 2 variables with Let now and it all works! Thank you!