**Tell us what’s happening:**

**Your code so far**

```
function largestPrimeFactor(number) {
if(number==2 || number==3){
return number;
}
var i,j,num,prime;
for(i=4;i<=number;i++){
num=1;
//checking it is a prime number or not
if(i%2!=0){var m=i/2;
for(j=2;j<=m;j++){
if(i%j==0){
num=0;
break;
}
}}
if(num==1 && number%i==0){
prime=i;
}
}
document.write(prime);
return prime;
}
largestPrimeFactor(13195);
```

**Your browser information:**

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

.

**Link to the challenge:**

https://learn.freecodecamp.org/coding-interview-prep/project-euler/problem-3-largest-prime-factor