专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅
实现代码如下: <script language="javascript" type="text/javascript"> Array.prototype.del = function(n) { (n < 0) this; this.slice(0, n).concat(this.slice(n + 1, this.length)); } function randomTest { var a = [阅读全文] [PDF]
最近发现两个重写Math.round方法的实现: Math.rand = function(l,u){ return Math.floor((Math.random() * (u-l+1))+l);} Math.prototype.rand = function(l,u){ return Math.floor((Math.random() * (u-l+1))+l);} Sample: Math.rand(1,10) 大家说这两个方法都可以吗? 那个是正确的做法?呵呵,测试一下就知道了:) [阅读全文] [PDF]
1 共2条 分1页