Project Euler Problem Two

Yesterday I posted my first euler-code. This time we will take a look at problem two, again with the help of some javascript running on node.js.

The problem is "Find the sum of all the even-valued terms in the [fibonacci] sequence which do not exceed four million."

My take on the solution was to run through all fibonacci numbers below 4.000.000 and adding them to the total, if they were equal. The next fibonacci number is calculated by always saving the last two numbers found.

You will need node.js to run this code.