摘要: functionfact_iter(product,counter,max_count){if(counter>max_count){returnproduct;}else{fact_iter(counter*product,counter+1,max_count);}//returneval((counter>max_count)?temp=product:fact_iter(counter*product,counter+1,max_count));}alert(fact_iter(1,1,6));这样的代码返回的是undefined。但是改写成函数式写法,就正确返回6!的值了 阅读全文
posted @ 2012-04-04 23:50 草珊瑚 阅读(1995) 评论(0) 推荐(0) 编辑