![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自看
沙鑫741
长路漫漫 唯贱作伴
展开
-
现有json数据,格式如下:json={a:[{b:'c'},'d'],e:'f'};请实现一个方法:get(json,'a[0].b'),使其返回值为c
function get(json,key){ return [].reduce.call(key.replace(/\[|\.|\]/g,''),(acc,a)=>acc[a],json)}var json = {a:[{b:'c'},'d'],e:'f'}原创 2020-04-07 15:32:13 · 1273 阅读 · 0 评论 -
自看
https://developer.mozilla.org/zh-CN/docs/Web/API/Window/requestAnimationFrame原创 2019-12-09 17:07:16 · 108 阅读 · 0 评论 -
// 获取url中"?"符后的字串
// 获取url中"?"符后的字串 getUrlQuery = () => { const url = window.location.search; const theRequest = {}; if (url.indexOf("?") !== -1) { const str = url.substr(1); const strs =...原创 2019-10-17 17:47:51 · 178 阅读 · 0 评论 -
js面试题
this:https://www.cnblogs.com/rinack/p/5698018.html冒泡:1.event.stopPropagation();事件处理过程中,阻止了事件冒泡,但不会阻击默认行为(它就执行了超链接的跳转)2.return false;事件处理过程中,阻止了事件冒泡,也阻止了默认行为(比如刚才它就没有执行超链接的跳转)还有一种有...原创 2019-03-25 16:49:03 · 231 阅读 · 0 评论 -
css面试题(自看)
css 选择符~>+> 是选择当前元素下第一层元素+ 兄弟选择符:选择当前节点下的第一个兄弟节点~兄弟选择符:选择当前节点下的所有兄弟节点如图:<html> <head> <title></title> </head> <meta charset="UTF-8"/> <s...原创 2019-03-25 16:58:06 · 135 阅读 · 0 评论 -
面試
https://github.com/rohan-paul/Awesome-JavaScript-Interviewshttps://github.com/nieyafei/front-end-interview-js前端面试interview的Js题目收集https://github.com/jimuyouyou/node-interview-questionsNode.js面试题,侧重...原创 2019-06-05 10:15:13 · 120 阅读 · 0 评论 -
数组key值去重
1: const ary = [{ a: 1, b: 12, c: 3 }, { a: 1, b: 11, c: 111 }, { a: 2, b: 18, c: 111 }]; const newArr = []; ary.map((item) => newArr.fin...原创 2019-03-29 10:53:03 · 531 阅读 · 0 评论