Fix typo in optional interface property example. PR716

This commit is contained in:
zhongsp 2018-01-27 07:54:33 +08:00
parent f2a048c805
commit 0b3bcff5db

View File

@ -85,7 +85,7 @@ interface SquareConfig {
function createSquare(config: SquareConfig): { color: string; area: number } {
let newSquare = {color: "white", area: 100};
if (config.color) {
if (config.clor) {
// Error: Property 'clor' does not exist on type 'SquareConfig'
newSquare.color = config.clor;
}