Skip to content

Commit 3a99e8b

Browse files
authored
Merge pull request basarat#566 from numb86/patch-3
fix sample code of index signature
2 parents 4a79b9d + 0bc91b1 commit 3a99e8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/types/index-signatures.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ As soon as you have a `string` index signature, all explicit members must also c
138138
```ts
139139
/** Okay */
140140
interface Foo {
141-
[key:string]: number
141+
[key:string]: number;
142142
x: number;
143143
y: number;
144144
}
145145
/** Error */
146146
interface Bar {
147-
[key:string]: number
147+
[key:string]: number;
148148
x: number;
149149
y: string; // ERROR: Property `y` must be of type number
150150
}
@@ -154,7 +154,7 @@ This is to provide safety so that any string access gives the same result:
154154

155155
```ts
156156
interface Foo {
157-
[key:string]: number
157+
[key:string]: number;
158158
x: number;
159159
}
160160
let foo: Foo = {x:1,y:2};

0 commit comments

Comments
 (0)