会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Stay foolish, stay hungry!
To change ! To do ! To realize !
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
25
下一页
2018年2月7日
201802071223_《更换两个二进制》
摘要: 1 var a = 00101100, 2 b=11010010; 3 4 a = a^b; 5 b = b^a; 6 a = a^b; 7 8 console.log(a); //11010010
阅读全文
posted @ 2018-02-07 12:25 Coca-code
阅读(123)
评论(0)
推荐(0)
2018年1月30日
201801301359——《注意Javascript这种形式》
摘要: //注意这种形式 function addX(y) { return function(x) { return x + y; } } // 调用 addX(2)(1.5); //3.5
阅读全文
posted @ 2018-01-30 14:04 Coca-code
阅读(92)
评论(0)
推荐(0)
2017年8月31日
201708310807_《算法-Javascript实现最大公约数》
摘要: function gcd(p,q){ if(q == 0){ return p; }else{ var r = p % q; return gcd(q, r); } }; gdc(12,8); //4
阅读全文
posted @ 2017-08-31 08:09 Coca-code
阅读(161)
评论(0)
推荐(0)
2017年8月29日
201708291826_《Javascript之prototype、__proto__、constructor KO!!!!!!》
摘要: /* *------------------------------------------------------------------------------- * minfengyin@gmail.com 2017-8-29 19:03 *----------------------------------------------------------------------...
阅读全文
posted @ 2017-08-29 19:06 Coca-code
阅读(157)
评论(0)
推荐(0)
2017年7月27日
201707271123_《Javascript的‘缓存’》
摘要: function memoizeFunction(func) { var cache = {}; return function() { var key = arguments[0]; if (cache[key]) { return cache[key]; } else { var ...
阅读全文
posted @ 2017-07-27 11:25 Coca-code
阅读(168)
评论(0)
推荐(0)
2017年6月18日
201706180310_《 Javascript (ES6)给变量一个hash串》
摘要: (() => { //UUID Fn-1 S4 = () => { return (((1+Math.random())*0x10000)|0).toString(16).substring(1); }; //UUID Fn-2 guid = () => { let me = this; return (me.S4()+m...
阅读全文
posted @ 2017-06-18 03:12 Coca-code
阅读(700)
评论(0)
推荐(0)
2017年4月22日
201704221048_《ES6模板字符串》
摘要: const tmpl = addrs => ` ${addrs.map(addr => ` ${addr.first} ${addr.last} `).join("")} `; const data = [ { first: "", last: "Bond" }, { first: "Lars", last: "...
阅读全文
posted @ 2017-04-22 10:48 Coca-code
阅读(176)
评论(0)
推荐(0)
2017年3月24日
201702241015——《关于Javascript的__proto__》
摘要: var arr = []; Object.getPrototypeOf(arr); 等效率于:arr.__proto__
阅读全文
posted @ 2017-03-24 10:17 Coca-code
阅读(159)
评论(0)
推荐(0)
2017年2月11日
201702112331_《js缺陷-数值比较补救》
摘要: const EPSILON = Math.pow(2, -53); //1.1102230246251565e-16 function epsEqu(x,y) { return Math.abs(x - y) < EPSILON; } epsEqu(0.1+0.2, 0.3) //true
阅读全文
posted @ 2017-02-11 23:32 Coca-code
阅读(153)
评论(0)
推荐(0)
2017年2月5日
201702051001_《JS替换全部》
摘要: var str = 'yinMinFeng'; var result = str.replace(/n/g,"ss"); //注意那个'g'全局 console.log(result); //yissMissFessg
阅读全文
posted @ 2017-02-05 10:04 Coca-code
阅读(128)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
25
下一页
公告