Hi guys, I’m having trouble figuring this out. I got the JS certification yesterday, but I’m still a bit uneasy I really know what I’m doing. I ran across a Code Wars algorithm challenge and was doing really good up to this point. Can anyone help me out?

The problem is in the conditional if (rangeDiff > 2) statement.

```
function rowSumOddNumbers(n) {
let firstOddNum = ((n * (n - 1)) + 1);
console.log(firstOddNum); // 1, 3, 7, 13, 21
let lastOddNum = (firstOddNum + (2 * (n - 1)));
console.log(lastOddNum); // 1, 5, 11, 19, 29
let rangeDiff = lastOddNum - firstOddNum;
console.log(rangeDiff); // 0, 2, 4, 6, 8
let rangeArr = [];
if (rangeDiff > 2){
for (let i = 0; i < lastOddNum && i > firstOddNum; i + 2) {
return rangeArr.push((i + (rangeDiff / 2)).toString);
}
console.log(rangeArr);
//Add to array firstOddNum + (rangeDiff / 2)
//are there any more numbers? for loop??
//Add all values of the array of odd numbers here.
} else if (rangeDiff < 2) {
if (rangeDiff === 0) {
return firstOddNum;
} else {
return firstOddNum + lastOddNum;
}
} else {
return undefined;
}
}
// 1st Odd next num
rowSumOddNumbers(1); //1 (firstOddNum + (2 * (n - 1))) (n = items in row)
rowSumOddNumbers(2); //3 (n = 2)
rowSumOddNumbers(3); //7 (n = 3)
rowSumOddNumbers(4); //13 (n = 4)
rowSumOddNumbers(5); //21 (n = 5)
```

Output

```
1
1
0
3
5
2
7
11
4
[]
13
19
6
[]
21
29
8
[]
```