上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页
摘要: const flattenArray = arr => { const flattened = [].concat(...arr); return flattened.some(v => Array.isArray(v))?flattenArray(flattened):flattened; } const arr = [1,[2,3,[3.1,3.2]],4]; c... 阅读全文
posted @ 2018-06-21 21:00 Coca-code 阅读(1117) 评论(0) 推荐(0)
摘要: DP ( Dynamic plan) ,即动态规划 DFS(Depth-First-Search ), 深度优先搜索 阅读全文
posted @ 2018-06-21 09:19 Coca-code 阅读(494) 评论(0) 推荐(0)
摘要: 一. forEach() 二. every 三. some 四. filter 五. map 六. reduce 七. reducerRight (用法与reducer大同) 八. find 九. findIndex 十. Array.keys()、Array.values()、Array.enti 阅读全文
posted @ 2018-06-03 16:32 Coca-code 阅读(201) 评论(0) 推荐(0)
摘要: 一. ES7的include 二. Array.of() 三. Array.from() 四. 扩展符 ... 阅读全文
posted @ 2018-06-03 12:58 Coca-code 阅读(452) 评论(0) 推荐(0)
摘要: 一. slice 二. join 三. toLocaleString 四. toString 五.concat 六. indexOf 七. lastIndexOf 八. (略,见下篇) 阅读全文
posted @ 2018-06-02 16:34 Coca-code 阅读(177) 评论(0) 推荐(0)
摘要: /*=========================================== 影响原数组,“有味”方法(9个)有: 1. splice() 向/从数组中添加/删除项目 2. sort() 数组排序 3. pop() 删除数组中最后一个元素 4. shift() 删除数组中第一个元素 5. push() 数组最后一个元素添加元素 ... 阅读全文
posted @ 2018-06-02 11:06 Coca-code 阅读(447) 评论(0) 推荐(0)
摘要: /* 因使用“===”,“!==”,结果一致, 便于记忆,也是各大公司推荐规范 */ (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 阅读(183) 评论(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 阅读(106) 评论(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 阅读(114) 评论(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 阅读(179) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页