上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页
摘要: //设置缓存 //name: 缓存key //value: 缓存value //iDay: 缓存过期时间 function setCookie(name, value, iDay){ var oDate = new Date(); oDate.setDate(oDate.getDate() + iDay); document.cookie = name + '=... 阅读全文
posted @ 2018-05-14 08:22 Coca-code 阅读(152) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-03-10 11:04 Coca-code 阅读(193) 评论(0) 推荐(0)
摘要: 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 阅读(114) 评论(0) 推荐(0)
摘要: //注意这种形式 function addX(y) { return function(x) { return x + y; } } // 调用 addX(2)(1.5); //3.5 阅读全文
posted @ 2018-01-30 14:04 Coca-code 阅读(81) 评论(0) 推荐(0)
摘要: 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 阅读(151) 评论(0) 推荐(0)
摘要: /* *------------------------------------------------------------------------------- * minfengyin@gmail.com 2017-8-29 19:03 *----------------------------------------------------------------------... 阅读全文
posted @ 2017-08-29 19:06 Coca-code 阅读(133) 评论(0) 推荐(0)
摘要: 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 阅读(155) 评论(0) 推荐(0)
摘要: (() => { //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 阅读(666) 评论(0) 推荐(0)
摘要: 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 阅读(148) 评论(0) 推荐(0)
摘要: var arr = []; Object.getPrototypeOf(arr); 等效率于:arr.__proto__ 阅读全文
posted @ 2017-03-24 10:17 Coca-code 阅读(144) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页