**Tell us what’s happening:**

The code is very slow and so fails the last 2 tests. Please help me optimise it

**Your code so far**

```
function divisibleTriangleNumber(n) {
let i=n+"".length, currentNatural=1
while(numberOfFactors(currentNatural)<n) {
currentNatural=i*(i+1)/2
i++
}
return currentNatural
}
function numberOfFactors(n) {
let f=0
for(let i=2; i<n/2; i++)
if(n%i==0)
f++
return f+2
}
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 6.1; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36`

.

**Challenge:** Problem 12: Highly divisible triangular number

**Link to the challenge:**