上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页
摘要: /* 因使用“===”,“!==”,结果一致, 便于记忆,也是各大公司推荐规范 */ (function(){ console.log('===== 1 ====='); console.log(false == 'false'); console.log(false == undefined); console.log(false == null); console.log(nul... 阅读全文
posted @ 2018-05-30 02:04 Coca-code 阅读(203) 评论(0) 推荐(0)
摘要: function getViewport(){ if (document.compatMode == "BackCompat"){ return { width: document.body.clientWidth, height: document.body.clientHeight } } else { ... 阅读全文
posted @ 2018-05-30 00:12 Coca-code 阅读(115) 评论(0) 推荐(0)
摘要: /* 摘自微信某前端公众号 如有雷同,纯属巧合 */ function init(arguments){ return new Promise(checkForArgument); } function checkForArgument(resolve, reject){ try{ if(arguments){ return r... 阅读全文
posted @ 2018-05-28 23:02 Coca-code 阅读(127) 评论(0) 推荐(0)
摘要: 1. 公式: 后验概率 = 先验概率 x 调整因子 P(A)称为"先验概率"(Prior probability),即在B事件发生之前,我们对A事件概率的一个判断。 P(A|B)称为"后验概率"(Posterior probability),即在B事件发生之后,我们对A事件概率的重新评估。 P(B| 阅读全文
posted @ 2018-05-28 01:01 Coca-code 阅读(204) 评论(0) 推荐(0)
摘要: //设置缓存 //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 阅读(171) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-03-10 11:04 Coca-code 阅读(201) 评论(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 阅读(122) 评论(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 阅读(92) 评论(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 阅读(158) 评论(0) 推荐(0)
摘要: /* *------------------------------------------------------------------------------- * minfengyin@gmail.com 2017-8-29 19:03 *----------------------------------------------------------------------... 阅读全文
posted @ 2017-08-29 19:06 Coca-code 阅读(155) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页