for (var a = 1, b = 1, sum = 0; b < 1000;) { sum += b; var temp = b ; b = a + b; a = temp; } alert(sum)