Created
January 17, 2017 15:53
-
-
Save agrcrobles/fd708f5a378305db35c2ac18369010f1 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
type Size = 1 | 2 | 3; | |
const GetSize = (): Size => { | |
const result: number = parseInt(Math.random() * 20); | |
if (result > 3) { | |
return 3; | |
} | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/41695887/how-can-i-fix-the-following-javascript-code-to-make-it-work-with-flowtype/41701341#41701341