class MyLogicContainer {
constructor(private x: number) { }
add(y: number) {
return this.x + y;
}
}
var MyLogicContainer = (function () {
function MyLogicContainer(x) {
this.x = x;
}
MyLogicContainer.prototype.add = function (y) {
return this.x + y;
};
return MyLogicContainer;
}());
<?php
class MyLogicContainer {
protected $x;
public function __construct($x) {
$this->x = $x;
}
public function add($y) {
return $this->x + $y;
}
}
type MyLogicContainer struct {
x float64
}
func NewMyLogicContainer(x float64) *MyLogicContainer {
return &MyLogicContainer{x: x}
}
func (m *MyLogicContainer) add(y float64) float64 {
return m.x + y
}