Littlombie's Nirvana

Novelty is the great parent of pleasure.


  • Home

  • Archives53

  • Tags31

  • About

  • Nirvana

ES6学习(18)- Module模块化

Posted on 2019-08-21 | Edited on 2019-08-27 | In ES6

基本概念

ES6 的模块化语法

Read more »

ES6学习(17)- Decorators

Posted on 2019-08-21 | Edited on 2019-08-27 | In ES6

Decorator

修饰器

修饰函数类的行为,也可以理解为 类的扩展功能

基本用法

需要安装插件

Read more »

ES6学习(16)- Generator

Posted on 2019-08-21 | In ES6

Generator 基本概念

异步编程的总解决方案
Generator 函数是 ES6 提供的一种异步编程解决方案,语法行为与传统函数完全不同。本章详细介绍 Generator 函数的语法和 API,它的异步编程应用请看《Generator 函数的异步应用》一章。

Generator 函数有多种理解角度。从语法上,首先可以把它理解成,Generator 函数是一个状态机,封装了多个内部状态。

执行 Generator 函数会返回一个遍历器对象,也就是说,Generator 函数除了状态机,还是一个遍历器对象生成函数。返回的遍历器对象,可以依次遍历 Generator 函数内部的每一个状态。

形式上,Generator 函数是一个普通函数,但是有两个特征。一是,function关键字与函数名之间有一个星号;二是,函数体内部使用yield表达式,定义不同的内部状态(yield在英语里的意思就是“产出”)。

Read more »

ES6学习(15)- Iterator

Posted on 2019-08-21 | In ES6

Iterator接口

在整个es6中,操作数据结构,数据结合的读取方式

Iterator 的基本用法

调用方式 arrSymbol.iterator

Read more »
12…14
Littlombie

Littlombie

Said less to do more!

53 posts
11 categories
31 tags
RSS
GitHub Weibo Zhihu webSite
Creative Commons
© 2020 Littlombie
Powered by Hexo v3.9.0
|
Theme – NexT.Mist v6.4.2