ECMAScript 6

03 Mar 2016, by

let和const声明

// IIFE 写法
(function () {
  var tmp = ...;
  ...
}());

// 块级作用域写法
{
  let tmp = ...;
  ...
}

模板字符串(string ${var})

Array.from可以将Iterator接口的对象转换为数组

判断相等

Proxy代理

模块化(export和import)

Promise

function getPosts() { return new Promise(function(resolve) { setTimeout(function() { resolve(posts); } , 3000); }); }