📅  最后修改于: 2022-03-11 14:48:17.140000             🧑  作者: Mango
interface NumberToString {
[n: number]: string;
}
var x: NumberToString;
x = { 1: 42 }; // Error
x[1].charAt(0); // OK
x['foo'] = 'bar'; // Still not an error, though