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
| interface Pessoa { | |
| nome: string; | |
| sobrenome: string; | |
| idade: number; | |
| } | |
| function informacoes(pessoa: Pessoa): string { | |
| return pessoa.nome + " " + pessoa.sobrenome + " tem " + pessoa.idade + " anos"; | |
| } | |
| informacoes({ nome: "Alex", sobrenome: "Hiroshi", idade: 0 }); | |
| informacoes({ nome: "Alex", sobrenome: "Hiroshi" }); // Erro. Falta a idade |
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
| function nomeCompleto(nome: string, sobrenome: string): string { | |
| return nome + " " + sobrenome; | |
| } |
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 nome: string = "Alex"; | |
| var diaAniversario: number = 27; |
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
| <TypeScriptOutDir>$(ProjectDir)assets\js</TypeScriptOutDir> |
NewerOlder