![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
花涛的个人博客
这个作者很懒,什么都没留下…
展开
-
防抖
防抖:在一段delay时间内的输入都为无效,每一段delay时间执行一次 <body> <input type="text" id="input"> <script> let timer; document.getElementById("input").addEventListener('input', function() { ...原创 2019-11-28 19:44:56 · 150 阅读 · 0 评论 -
箭头函数this指向对象
const app = { abc() {//1箭头函数寻找到最近作用域 console.log(this);//object, abc函数中拥有this定义,箭头函数寻找到的最近的this定义,指向当前对象app setTimeout(() => { cons...原创 2019-11-14 23:16:56 · 231 阅读 · 0 评论 -
js中filter,map,reduce方法
let arr = [10, 24, 31, 123, 214, 133]; let num = arr.filter(n => n < 100).map(n => n * 2).reduce((pre, n) => pre + n, 1); console.log(num);//131 console.log(arr);//[ 10, 24, 31, 123, 214, ...原创 2019-11-08 18:31:34 · 147 阅读 · 0 评论