Skip to content

Instantly share code, notes, and snippets.

@corocoto
Created July 31, 2020 11:08
Show Gist options
  • Select an option

  • Save corocoto/a2cafbc0cbafec78ce7ced12f1800a96 to your computer and use it in GitHub Desktop.

Select an option

Save corocoto/a2cafbc0cbafec78ce7ced12f1800a96 to your computer and use it in GitHub Desktop.
Flow | variables defining
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