Skip to content

Commit

Permalink
hello com interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellevissa committed Apr 3, 2020
1 parent c19b198 commit 23efb23
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/*.js
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# helloworldTS
Hello world com TypeScript, seguindo a documentação: https://www.typescriptlang.org/docs

* To compile:

`tsc hello.ts`
12 changes: 12 additions & 0 deletions src/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
interface Person {
firstName: string;
lastName: string;
}

function hello(person: Person) {
return "Hello, " + person.firstName + " " + person.lastName;
}

let user = { firstName: "Rafael", lastName: "Levi" };

console.log(hello(user));

0 comments on commit 23efb23

Please sign in to comment.