**Tell us what’s happening:**

I test both case and it shows 9009 and 906609 in my console.

But I cant pass the test

**Your code so far**

```
function largestPalindromeProduct(digit) {
var maxpalindrome = 0;
var factor = 0;
for(let i = Math.pow(10, digit-1); i<Math.pow(10,digit); i++){
var num = ''+i;
var newnum = num;
for (let j = num.length; j>0; j--){
newnum += num.charAt(j-1);
}
for(let k = Math.pow(10, digit-1); k<Math.pow(10,digit); k++){
factor = (Number(newnum))/k;
if((factor%1 === 0) && String(factor).length == digit){
maxpalindrome = newnum;
}
}
}
return console.log(maxpalindrome);
}
largestPalindromeProduct(2);
```

**Your browser information:**

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

.

**Link to the challenge:**

https://learn.freecodecamp.org/coding-interview-prep/project-euler/problem-4-largest-palindrome-product/