摘要: function classof(o) { if (null == o) return 'Null'; if (undefined == o) return 'Undefined'; return Object.prototype.toString.call(o).slice(8, -1);}classof([]);classof({});classof(Date);classo... 阅读全文
posted @ 2014-08-10 10:59 PengpengSong 阅读(225) 评论(0) 推荐(0) 编辑
摘要: function factorial(n) { if (isFinite(n) && n > 0 && n == Math.round(n)) { // 有限的正整数 if (!(n in factorial)) // 没有缓存结果 factorial[n] = n * factorial(n - 1)... 阅读全文
posted @ 2014-08-10 10:03 PengpengSong 阅读(426) 评论(0) 推荐(0) 编辑