在ES5中我们通常通过构造函数,定义并生成新对象。例如:``` function Point(name,age){ this.name=name; this.age=age; } Point.prototype={ Who:function(){ return "My name is "+this...
1\. 生成器函数声明 function name(args){}; 2\. yield使用```function hello(){ console.log('before hello'); //可看到hello()并不会立刻执行函数, 到第一次next调用时才会 var name = yield 'please input your name'...
1.变量声明 let 和 constlet与const 都是块级作用域, let```function name(){ let age = 12; //age只在name()函数中存在}``` const```const name = 'tom'name = 'jack'//再次赋值会报错``` 2.字符串模板 Es5```/...
最新评论