Last active
August 27, 2017 06:01
-
-
Save EcutDavid/0cd046b18d01feb1f0fef063cc16e939 to your computer and use it in GitHub Desktop.
Flappy bird
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
const optionsInPlainJS = [{ | |
// Oooops | |
local: 'EN', | |
index: 1 | |
}, { | |
locale: 'JP', | |
index: 2 | |
}, { | |
locale: 'CH', | |
index: 3 | |
}]; | |
type Option = { | |
locale: string; | |
index: number; | |
} | |
const options: Option[] = [{ | |
locale: 'EN', | |
index: 1 | |
}, { | |
// TS will yield an error here | |
local: 'JP', | |
index: 2 | |
}, { | |
locale: 'CH', | |
index: 3 | |
},]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment