03 2013 档案

摘要:斐波那契是1,1,2,3,5,8,13,21。。。。。 即前两项之和为第三项。程序实现如下普通版的斐波那契: 1 <script type="text/javascript"> 2 function f(num) 3 { 4 5 if(num<=0) 6 7 { 8 9 console.log('请输入大于0的正整数');10 return ; 11 12 }13 14 else if(num<=2 && num>0)15 {16 return 1;17 }18 else19 {20 return f(num-2 阅读全文
posted @ 2013-03-11 10:13 TL_LEE 阅读(649) 评论(0) 推荐(0)
摘要:1, 1 <script type="text/javascript"> 2 function A() 3 { 4 this.name='a'; 5 } 6 function B() 7 { 8 9 }10 11 12 B.prototype=new A();13 var obj=new B();14 15 alert(obj.name);16 </script>2, 1 <script type="text/javascript"> 2 function A() 3 { 4 this.name= 阅读全文
posted @ 2013-03-08 14:48 TL_LEE 阅读(1127) 评论(0) 推荐(0)