SOURCE

function TestObj(){
    this.console = function(str){
        console.log(str);
    }
    this.name = "";
}
function run1(){
    var obj = new TestObj();
    obj.console("123123");
    console.log(obj);
}
//类的定义
class Animal {
	//ES6中新型构造器
    constructor(name) {
        this.name = name;
    }
    //实例方法
    sayName() {
        console.log('My name is '+this.name);
    }
}
class TestClass1 extends Animal{
    constructor(name) {
        super(name);
    }
}
function run2(){
    var test = new Animal("11123");
    Animal.prototype.age = 12;//更改类属性或方法
    console.log(test);
    test.age = 13;
    console.log(`name:${test.name}`);
    console.log(`age:${test.age}`);    
}
run2();
console 命令行工具 X clear

                    
>
console