摘要: 一.es6的箭头函数es6箭头函数内部没有this,使用时会上朔寻找最近的this不可以做构造函数,不能使用new命令,因为没有this函数体内没有arguments,可以使用rest参数代替不能用yield,不能使用generator函数二.疑问下面代码中的箭头函数arrows的this指向win 阅读全文
posted @ 2020-03-20 23:14 努力~努力再努力~ 阅读(753) 评论(0) 推荐(0) 编辑
摘要: 最近在学习vue的单页面应用开发,需要vue全家桶,其中用到了VueRouter,在路由的设置和跳转中遇到了两个对象$router 和 $route ,有些傻傻分不清,后来自己结合网上的博客和自己本地的Vue devtools结构了解了他们的区别 1.router是VueRouter的一个对象,通过 阅读全文
posted @ 2020-03-20 23:03 努力~努力再努力~ 阅读(6794) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <meta charset="utf-8"> <title>last-child 和 last-of-type区别</title> <style type="text/css"> p:last-child{ color: red; } p:la 阅读全文
posted @ 2020-03-20 17:11 努力~努力再努力~ 阅读(665) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/f1f39d5b2a2e 1. javascript的typeof返回哪些数据类型. 答案:string,boolean,number,undefined,function,object 2. 例举3种强制类型转换和2种隐式类型转换? 答案:强制( 阅读全文
posted @ 2020-03-20 16:43 努力~努力再努力~ 阅读(1034) 评论(0) 推荐(1) 编辑
摘要: let arr=[1,2,3,4,5]; arr.b='100'; for for(let i=0;i<arr.length;i++){ console.log(arr[i]); } for是编程式 forEach arr.forEach(function(i){ console.log(item) 阅读全文
posted @ 2020-03-20 16:40 努力~努力再努力~ 阅读(1517) 评论(0) 推荐(1) 编辑
摘要: 1、forEach:遍历开始以后无法停止,如果要遍历整个数组,那就使用这个方法; 2、map:根据当前数组映射出一个新的数组; 3、some:遍历整个数组,返回值true就停止循环(返回false继续循环) 返回值:如果数组中的有一项回调函数返回true,那么结果为true,否则为false;(或者 阅读全文
posted @ 2020-03-20 16:39 努力~努力再努力~ 阅读(2662) 评论(0) 推荐(1) 编辑