Created
February 13, 2019 00:14
-
-
Save gkucmierz/5f6ee4a23bc990c1ea1a6cb13b9f3529 to your computer and use it in GitHub Desktop.
This file contains 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
let f = [1, 1]; | |
let sum = 0; | |
while(f[0] < 4e6){ | |
f.push(f[0]+f[1]); | |
let e = f.shift(); | |
sum += e % 2 === 0 ? e : 0; | |
} | |
console.log(sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment