随笔分类 -  es6

回顾一下es6。
摘要:带着以下疑问来解答以下问题,你会学到很多 1. 回调深渊为什么会出现,为什么需要回调 ? 2. ES6为什么会出现Promise? 3. 回调的作用是什么? 跟闭包有关吗? ES5 ~ ES6 回调深渊 -示例 阅读全文
posted @ 2018-08-07 10:22 Sunsin 阅读(686) 评论(0) 推荐(0) 编辑
摘要:更新时间: 2018-7-31 首次更新. 先生成package.json 再安装以下npm插件 看起来应该是这样的(除版本号外),详细的配置文件不细说 webpack.config.js 入口文件为app.js,你可以随意写路径或者更改js. 运行命令:npm run start 正确的运行代码应 阅读全文
posted @ 2018-07-31 13:51 Sunsin 阅读(2074) 评论(0) 推荐(0) 编辑
摘要:END... 阅读全文
posted @ 2018-07-31 13:02 Sunsin 阅读(267) 评论(0) 推荐(0) 编辑
摘要:1 2 'use strict'; 3 let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; 4 5 6 // 除去取余2的 - es6 7 let es5OddNumbers = numbers.filter(function (number) { 8 return number % 2; 9 }); 10 console.log... 阅读全文
posted @ 2018-07-31 13:01 Sunsin 阅读(299) 评论(0) 推荐(0) 编辑
摘要:foreach ... 阅读全文
posted @ 2018-07-21 17:43 Sunsin 阅读(1463) 评论(0) 推荐(0) 编辑
摘要:es6新的字符串,操作... 具体,请查看es6 api. 阅读全文
posted @ 2018-07-21 17:10 Sunsin 阅读(164) 评论(0) 推荐(0) 编辑
摘要:注意:es6模板的内容框选是``键盘左上角的重音符 ,而es5是双引号或单引号. 阅读全文
posted @ 2018-07-21 13:25 Sunsin 阅读(330) 评论(0) 推荐(0) 编辑
摘要:1 class User { 2 constructor(name, age) { 3 this.name = name; 4 this.age = age; 5 } 6 7 changeName(name) { 8 this.name = name; 9 } 10 11 changeA... 阅读全文
posted @ 2018-07-21 13:12 Sunsin 阅读(189) 评论(0) 推荐(0) 编辑
摘要:今天用node纠结了半天,明明是正确的语法,一直报错,原来node和chrome并不支持es6语法.... 1. npm install package.json 1 { 2 "name": "ES6", 3 "version": "1.0.0", 4 "description": "", 5 "m 阅读全文
posted @ 2018-07-21 10:53 Sunsin 阅读(2347) 评论(0) 推荐(0) 编辑
摘要:promise - 反复进行回调函数. 阅读全文
posted @ 2018-07-20 15:43 Sunsin 阅读(171) 评论(0) 推荐(0) 编辑
摘要:块级绑定 js的处理机制和我们大家想象的完全不同,并不完全是所谓函数调用以及上下执行那样简单,它是存有”域”的本质区别的。 var具有全局污染特性,所以es6才会出现let 、const。 下面通过一些实例来给大家解释一下: 阅读全文
posted @ 2017-10-27 16:43 Sunsin 阅读(451) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示