ES6中引入了generatorfunction* get() { var result1 = yield c; var result2 = yield b; var result3 = yield a; console.log(result1); console.lo...
分类:
其他好文 时间:
2016-01-08 17:09:24
阅读次数:
164
Ranking(2) Modules本章节讲述在ES6中如何构建Modules1、开始。在ECMAScript 6中,modules 是存储在文件中,一般而言是一个文件一个模块。有两种方式将模块中的方法暴露给外部使用1.1 Multiple named exports//多个暴露的方法或者属性//-...
分类:
其他好文 时间:
2016-01-06 17:43:47
阅读次数:
223
原文地址:https://hacks.mozilla.org/2015/08/es6-in-depth-modules/ ES6 是 ECMAScript 第 6 版本的简称,这是新一代的 JavaScript 的标准。ES6 in Depth是关于 ES6 的一系列新特性的介绍。 ES6 ...
分类:
其他好文 时间:
2016-01-04 13:16:22
阅读次数:
152
1. fill() arr.fill(value, [start], [end]) fill()方法向数组的开始位置到结束位置填充一个静态值 参数: value: 要填充的值 start: 可选。开始位置,默认为0 end: 可选。结束位置,默认为length-1 返回: ...
分类:
编程语言 时间:
2016-01-04 01:25:32
阅读次数:
270
Creating Object:Example 1:let name = "Brook";let totalReplies = 249;let avatar = "/users/avatars/brook-user-1.jpg";let user = {name, totalReplies, ava...
分类:
其他好文 时间:
2016-01-03 18:18:07
阅读次数:
129
function spinner(target, options = {}){ let defaults = { message: "Please wait", spinningSpeed: 5, cssClass: ".is-spinning" }; let setting...
分类:
其他好文 时间:
2016-01-03 18:12:02
阅读次数:
120
The spread operator allow us to split an Array arguement into individual elements.getRequest("/topics/17/tags", function(data){ let tags = data.tag...
分类:
其他好文 时间:
2016-01-03 17:33:40
阅读次数:
156
1. Default Value of function param:The functiondisplayTopicsPreview()raises an error on the very first line when called with no arguments. Let's fix t...
分类:
其他好文 时间:
2016-01-02 07:03:05
阅读次数:
156
V8中的Function.prototype.bind有50倍性能的提升Chrome Canary版中的js最新性能已经完成了91%年底的时候,ES6的支持情况:chrome:91% (w. flag), FF — 90% (unflagged!), Edge — 90% (flagged), We...
分类:
其他好文 时间:
2015-12-30 13:22:06
阅读次数:
142
var ary = [ { id: 1, name: "Zhentian" }, { id: 2, name: "Alice" }];for..inPrint out the props namefor(let person in ary){ console.log...
分类:
其他好文 时间:
2015-12-26 18:47:27
阅读次数:
121