Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

Latest commit

 

History

History
16 lines (14 loc) · 206 Bytes

0002.md

File metadata and controls

16 lines (14 loc) · 206 Bytes
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);