class ClassWithArrows {
hi = () => {
return 'Hi' + '!';
}
bye = () => {
return 'Bye' + '!';
}
message = () => {
return this.hi() + this.bye();
}
}
class ClassWithArrowsTranspiled {
constructor() {
this.hi = () => {
return 'Hi' + '!';
};
this.bye = () => {
return 'Bye' + '!';
};
this.message = () => {
return this.hi() + this.bye();
};
}
}
class ClassWithBindInCtor {
constructor() {
this.message = this.message.bind(this);
}
hi() {
return 'Hi' + '!';
}
bye() {
return 'Bye' + '!';
}
message() {
return this.hi() + this.bye();
}
}
const classWithArrows = new ClassWithArrows();
const classWithArrowsTranspiled = new ClassWithArrowsTranspiled();
const classWithBindInCtor = new ClassWithBindInCtor();
let counter;