Skip to content

Instantly share code, notes, and snippets.

@c4milo
Created July 29, 2010 21:28
Show Gist options
  • Save c4milo/499293 to your computer and use it in GitHub Desktop.
Save c4milo/499293 to your computer and use it in GitHub Desktop.
var nums = [1, 2];
var add = 2;
while(add < 4000000) {
var term = nums[1] + nums[0];
nums.push(term);
if(term % 2 == 0) {
add += term;
}
nums.shift();
}
console.log('result: '+ add);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment