1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

Update Greeter example to Adder

This commit is contained in:
joshvera 2018-12-10 16:21:42 -05:00
parent ea4c9462bd
commit 75ac094409
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
import { Greeter } from "./class2"
import { Adder } from "./class2"
const foo = new Greeter("world")
foo.greet()
var foo = new Adder(5)
foo.add()

View File

@ -1,11 +1,11 @@
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
class Adder {
summand: number;
constructor(summand: number) {
this.summand = summand;
}
greet() {
return "Hello, " + this.greeting;
add() {
return 4 + this.summand;
}
}
export { Greeter }
export { Adder }