
学习记录
愿煜愁殇
无~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
模拟几个函数的实现
在基础知识的学习中要注重深入,模拟一些常用函数的学习便是很好的办法,一下皆是本人学习记录,无关对错模拟bindFunction.prototype.newBind = function (target, ...args){ target = target || window let self = this let temp = function ()...原创 2018-09-05 13:37:55 · 247 阅读 · 0 评论 -
拖拽功能函数
实现拖拽功能的简单函数 class Drag{ constructor(el){ this.el = document.querySelector(el) this.distance = { x: 0, y: 0 } this.init() ...原创 2018-09-06 13:50:06 · 298 阅读 · 0 评论 -
Map 和 Set
Map是一种类似于json的数据格式,map的键key可以是任意类型*/let m = new Map()// 添加m.set(123, 'abc').set(234, 'bcd').set(456, 'doh')// 获取m.get(123) // 'abc'// 删除m.delete(456)// 判断是否有keym.has(123) //true// 清空...原创 2018-09-06 20:29:34 · 117 阅读 · 0 评论 -
es6关于数组的几个函数
关于数组的函数mapmap遍历方法的回调函数里有三个参数,(val, index, all),分别代表值、下标、被循环的数组。let arr = [{title:'new1',read:200,hot:true}, {title:'new2',read:300,hot:true}, {title:'new3',read:400,hot:tru...原创 2018-09-06 21:13:57 · 376 阅读 · 0 评论 -
generator 与 async await
generator 函数可用于解决异步的深度嵌套,函数与函数名间加上* 就能成为generator函数,next() 依次执行yield域,return后结束function * show(){ yield 'welcome'; yield 'to'; return 'toilet'}let a = show();console.log(a.next(...原创 2018-09-07 14:10:00 · 532 阅读 · 0 评论