## Challenge: Sum All Odd Fibonacci Numbers

**Link to the challenge:**

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers

## Challenge Guide

**Solution from the challenge guide.**

```
function sumFibs(num) {
let prevNumber = 0;
let currNumber = 1;
let result = [];
while (currNumber <= num) {
if (currNumber % 2 !== 0) {
result.push(currNumber);
}
currNumber += prevNumber;
prevNumber = currNumber - prevNumber;
}
return result;
}
```

Please I need an explanation of why `prevNumber`

is assigned to `currNumber - prevNumber`

in the `while`

loop. That’s where I’m confused.