Created
January 17, 2016 05:32
-
-
Save jajoosam/8c8cc04516d245388c06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var limit = 4000000; | |
var a = 1; | |
var b = 1; | |
var sum = 0; | |
while(b < limit){ | |
if (b % 2 === 0){ | |
sum += b; | |
} | |
h = a+b; | |
a = b; | |
b = h; | |
} | |
document.write(sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment