01 2012 档案

摘要: 1: var n3 = 52.3685; 2: document.writeln(n3 >> 0);// 52 3: 可以去掉小数。如上代码,就是这么简单右移位操作导致小数部分丢失,为何会这样呢?左移位可以吗?移位操作是否都有如此功能呢?带着疑问又写了一段代码用来测试以上想法,继续上代码 1: { 2: n = 52.123456; 3: //...阅读全文
posted @ 2012-01-30 17:53 kkun 阅读(193) | 评论 (0) 编辑
摘要: 封装Encapsulation 如下代码,这就算是封装了 (function (windows, undefined) { var i = 0;//相对外部环境来说,这里的i就算是封装了 })(window, undefined);继承Inheritance (function (windows, undefined) { //父类 function ...阅读全文
posted @ 2012-01-06 16:48 kkun 阅读(184) | 评论 (0) 编辑