一、类的声明和实例化
1.类的声明
//声明var cat=function(){ this.name='aha'; }; console.log(cat); //Es6中的声明class cat1{ constructor() { this.name='cat2'; } } console.log(cat1);
输出:
2.类的实例化
var cat2=new cat("black",4)
二、继承
构造函数,原型链继承: