Created
November 22, 2019 23:35
-
-
Save jaroslav-kubicek/ef2d0244f1415654cb1f507ddbba2ecd to your computer and use it in GitHub Desktop.
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
/* @flow */ | |
// uncomment this comment :) // flowlint unclear-type:error | |
// SEE https://flow.org/en/docs/linting/rule-reference/#toc-unclear-type | |
// "any" type - not very helpful | |
const foo: any = 42; | |
foo.bar.baz | |
// primitives | |
const name: string = "kubajz"; | |
const age: number = 30; | |
const falsy: boolean = false; | |
// object | |
type Person = { name: string, surname: string, sex: "MALE" | "FEMALE" } | |
const variables: Person = { | |
name: "Jarda", | |
surname: "Kubicek", | |
sex: "MALE", | |
}; | |
// function | |
const getName = (person: Person) => { | |
return person.name; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment