mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-13 15:38:06 -05:00
18 lines
298 B
TypeScript
18 lines
298 B
TypeScript
export default function main() {
|
|
function Counter() {
|
|
this.value = 0;
|
|
}
|
|
|
|
Counter.prototype.inc = function() {
|
|
this.value++;
|
|
}
|
|
|
|
let counter = new Counter();
|
|
counter.inc();
|
|
counter.inc();
|
|
const counter2 = counter;
|
|
counter.inc();
|
|
|
|
return [counter.value, counter2.value];
|
|
}
|