let sum = 0;
let target = 4000000;
let a = 1, b = 1, c = 2;
while (c <= target) {
if (c % 2 === 0) {
sum += c;
}
a = b;
b = c;
c = a + b;
}
console.log(sum);
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.