執行 ❯
Node 伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
const nameAgeMap: { [index: string]: number } = {}; nameAgeMap.Jack = 25; // no error nameAgeMap.Mark = "Fifty"; // Error: Type 'string' is not assignable to type 'number'. console.log(nameAgeMap);
prog.ts(3,7): error TS2322: Type 'string' is not assignable to type 'number'.