Skip to content

Instantly share code, notes, and snippets.

@naush
Created July 14, 2010 15:28
Show Gist options
  • Save naush/475565 to your computer and use it in GitHub Desktop.
Save naush/475565 to your computer and use it in GitHub Desktop.
function fib_iterative(n) {
var a = 0;
var b = 1;
var c = 0;
for (i = 0; i < n; i++) {
c = a + b;
a = b;
b = c;
}
this.result = a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment