Skip to content

Instantly share code, notes, and snippets.

@rakibulalam
Created October 27, 2017 08:32
Show Gist options
  • Save rakibulalam/26621a01bd9552e3d9d1726737578469 to your computer and use it in GitHub Desktop.
Save rakibulalam/26621a01bd9552e3d9d1726737578469 to your computer and use it in GitHub Desktop.
fibo.js
for (var sum = 0, i = 0, j = 1, k = 2; 4e6 > j + k; i++) i = j + k, j = k, k = i, sum += 0 == i % 2 ? i : 0;
result: '4613730'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment