This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculation { | |
constructor(private x: number, private y: number) {} | |
add() { | |
console.log(this.x + this.y); | |
} | |
} | |
let calc = new Calculation(10, 20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Calculation = /** @class */ (function () { | |
function Calculation(x, y) { | |
this.x = x; | |
this.y = y; | |
} | |
Calculation.prototype.add = function () { | |
console.log(this.x + this.y); | |
}; | |
return Calculation; | |
}()); |