JSFiddle - React, Tailwind, and code Playground
by brbrown
JavaScript
function fibSum(n){
var a = 0, b =1; total =0;
if (n < 2){
return 1;
}
while ((a && b) < n){
c = a + b
if (c%2==0){
total +=c
}
a = b
b = c
}
return total}
console.log(fibSum(4000000))