标签:art 技术分享 result function last ret tla style 递归
function iterFib(n){
var last=1;
var nextlast=1;
var result=1;
for(var i=2;i<n;++i){
result=last+nextlast;
nextlast=last;
last=result;
}
return result;
}
alert(iterFib(10));//将显示55
标签:art 技术分享 result function last ret tla style 递归
原文地址:http://www.cnblogs.com/brucemengbm/p/6939958.html