摘要: 以斐波那契数列为例 1, 1, 2, 3, 5, 8 。。。。。 function fb ( n ) { if (n<=0) {return 1}; return fb(n-1) + fb(n-2) } 优化后的尾递归 function fb(n , ac1=1, ac2 = 1) { if ( n 阅读全文
posted @ 2017-02-15 17:08 她在村口等我 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 例如 : 将函数的 arguments参数转成数组格式 es5: [].slice.call(arguments) Array.prototype.slice.call(arguments) es6: Array.from(arguments) 能将具有 Iterator接口的数据格式(Set, M 阅读全文
posted @ 2017-02-15 15:52 她在村口等我 阅读(349) 评论(0) 推荐(0) 编辑