Created
August 26, 2018 22:10
-
-
Save glaucia86/af9f78d79da2ad5fe082bd37df5f8691 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Arquivo: unknown-type.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
let textoExemplo: unknown = 10; | |
// O código abaixo não irá executar uma vez que 'textoExemplo' é do tipo 'unknown' | |
textoExemplo.x.prop; | |
textoExemplo.y.prop; | |
textoExemplo.z.prop; | |
textoExemplo(); | |
new tetextoExemplost(); | |
upperCase(textoExemplo); | |
textoExemplo `Oi Pessoal!`; | |
function upperCase(x: string) { | |
return x.toUpperCase(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment