05 2018 档案

摘要:/* 因使用“===”,“!==”,结果一致, 便于记忆,也是各大公司推荐规范 */ (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 阅读(185) 评论(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 阅读(108) 评论(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 阅读(118) 评论(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 阅读(186) 评论(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 阅读(158) 评论(0) 推荐(0)