Created
July 31, 2020 11:08
-
-
Save corocoto/a2cafbc0cbafec78ce7ced12f1800a96 to your computer and use it in GitHub Desktop.
Flow | variables defining
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 isFetching: boolean = false; | |
| var luckyNumber: number = 10; | |
| var notSoLuckyNumber: number = NaN; | |
| var myName: string = 'Artem'; | |
| var dataNull: null = null; | |
| var dataUndef: void = undefined; | |
| var messages: Array<string> = ['hello', 'world', '!']; | |
| var aboutMe: { name: string, age: number } = { | |
| name: 'Artem', | |
| age: 20, | |
| }; | |
| /* You could define objects as maps where you map a string to some value. */ | |
| var namesAndCities: { [name: string]: string } = { | |
| Preethi: 'San Francisco', | |
| Vivian: 'Palo Alto', | |
| }; | |
| var someObject: Object = {}; | |
| someObject.name = {}; | |
| someObject.name.first = 'Preethi'; | |
| someObject.age = 26; | |
| var iCanBeAnything:any = 'LALA' + 2; | |
| var calculateArea = (radius: number): number => { | |
| return 3.14 * radius * radius | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment