body{
  background-color: black;
}

//Evaluator function: this functions checks if it's a palindrom product and will accept and array of numbers

const eval = (arr) => {
  let top = arr.length - 1;
  let bot = 0;
  x = 0;
  y = 0;
  minLen = arr.length / 2;
  score = 0;
  
  for (i = arr.length; i > minLen; i--) {
    x = top;
    y = bot;
    if (arr[x] == arr[y]) {
      score++;
    }
    top --;
    bot ++;
  }
  
  return score == minLen;
}




// Putting the number's digit in an array
const retDigits = (num) => {
  numArr = [];
  x = num;
  zeros = num.toString().length - 1;
  bigNum = 1;
  
  //let's find out how many digits our num has:
  for (i = zeros; i > 0; i--) {
    bigNum = bigNum * 10;
  }
  // getting the digits and pushing them in our array one by one:
    for (i = bigNum; i >= 1; i /= 10) {
      if (x / i >= 1) {
        numArr.push(Math.floor(x / i));
        x = x % i;
      }
      else {
        numArr.push(0);
      }
    } 
  
  return eval(numArr) === true;

}


//to produce multiplies of two digits numbers! if it works can change it to three digit numbers

const producer = () => {

  let ans = 0;
  for (let i = 999; i>=100; i--){
    for (let q = 999; q>=10.; q--){
      let x = i * q;
      if (x < ans) {break;}
      
      if (retDigits(x) && x > ans) {
        ans = x;
      }
    }
  }
  return ans
}


console.log(producer());
 






External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.