
es6
drunk喵咪
学习这件事,不是缺乏时间,而是缺乏努力。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ES6模块化
ES6的模块化CommonJS模块化module.exports = 暴露接口require(模块名称/路径)ES6模块化export 暴露的接口import {} from "模块名称/路径"1、定义模块,通过export暴露接口module1.js export let a = 3; export function sayHello(){}index.js...原创 2019-10-14 20:03:34 · 200 阅读 · 0 评论 -
es6中的类
类是构造函数的语法糖(1) es5构造函数function Animal(name,age){ this.name = name; this.age = age; } Animal.prototype.sayName = function(){ console.log("my name is",this.name); } Animal.prototype.sayAge = ...原创 2019-10-14 19:59:57 · 115 阅读 · 0 评论 -
es6的Generator函数和Async函数
Generator函数作用:1)迭代器的生成函数2)将异步操作同步化promise封装了异步操作$.get("/customer/findAll").then((response)=>{ //通过回调函数来获取异步操作的结果})(1)声明(语法)function* foo(){ let a = "hello" yield a; yield "world"; re...原创 2019-10-14 19:48:32 · 152 阅读 · 0 评论