I’m trying to solve project Euler problem 4. I wrote this code and tried to improve it. but I don’t understand what’s wrong with it that it doesn’t give the answer

```
function largestPalindromeProduct(n) {
var bigNum;
var base;
base = Math.pow(10, n);
bigNum = base-1;
maxPal(bigNum);
}
largestPalindromeProduct(3);
function maxPal(bigNum) {
var mayPal;
mayPal = bigNum * (bigNum - 1) * (bigNum - 2);
if (isPal(mayPal) == true) {
return mayPal;
} else {
bigNum--;
maxPal(bigNum);
}
}
function isPal(number) {
var rem, temp, final = 0;
var number;
temp = number;
while (number > 0) {
rem = number % 10;
number = parseInt(number / 10);
final = final * 10 + rem;
}
if (final == temp) {
return true;
} else {
return false;
}
}
```