Sign in
gerrit
/
java-prettify
/
f4e88fcd03c1bf2cf4913b0c95c76b2eb973b8b2
/
.
/
test
/
prettify
/
PrettifyTest
/
source
/
javascript.txt
blob: 3bc54e3accbb39e82ab9e98705a0940274d141a4 [
file
] [
log
] [
blame
]
/**
* nth element in the fibonacci series.
* @param n >= 0
* @return the nth element, >= 0.
*/
function fib(n) {
var a = 1, b = 1;
var tmp;
while (--n >= 0) {
tmp = a;
a += b;
b = tmp;
}
return a;
}
document.write(fib(10));