Class 基本用法 class n { constructor(x,y) { this.x = x; this.y = y; console.log(x,y) } proint() { console.log(' this is proint ') } } var newObject = new n(1,2); // c {x: 1, y: 2} newObject.proint(); // this is proint 现在不用像以前. function o(x,y) { this.x =…