TypeScript interface for object with arbitrary numeric property names?
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
TypeScript interface for object with arbitrary numeric property names?
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us