function Point(x,y) {
this.x = x;
this.y = y;
}
Point.prototype.toString = function(){
return '('+ this.x + this.y +')';
}
var p = new Point(1,2);
class Point1 {
constructor(x,y) {
this.x = x;
this.y = y;
}
toString() {
return '('+ this.x + this.y +')';
}
}
console.log(typeof Point1)
console.log(Point1.prototype.constructor)
class Bar {
doStuff(){
console.log('stuff');
}
}
var b = new Bar();
b.doStuff()
class Point2 {
constructor() {
}
toString() {
}
toValue() {
}
}
Point2.prototype = {
constructor(){},
toString(){},
toValue(){}
}
console