classthing{constructor(_id){this._id = _id
}getid(){returnthis._id
}showId(){returnthis._id
}}var t =newthing(100)
console.log(t.id)
console.log(t.showId())
Generators
function*range(start, end){while(start < end){yield start
start +=1}}for(let i ofrange(0,10)){
console.log(i)}
for-in for-of
var b ={ a:'tom'}var a =['a', b,'c']
a.forEach((item)=>{
console.log(item)})for(var index in a){
console.log(a[index])//value better to use on object//console.log(typeof(index)) //string}for(var value of a){// better ot use on array
console.log(value)}
ES2015部分新特性示例ES2015部分新特性示Arrow functionsBlock scoping with let. Compare to varDefault paramsVariadic function parametersSpread operatorProperty shorthandComputed object keysMethods notation in objects...