Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

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
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript allow object subset of interface 
Typescript :: create seperate file for requests react 
Typescript :: objects all django what is returned 
Typescript :: how to access contents of an array from another class in java 
Typescript :: jest aliases typescript storybook 
Typescript :: how to add lists haskell 
Typescript :: nativescript alert 
Typescript :: typescript map interface 
Typescript :: how to convert js to ts 
Typescript :: accout 
Typescript :: adding objects to existing legend 
Typescript :: Ionic toast animation 
Typescript :: using multer -s3 amazon server image upload error access denied 
Typescript :: tkinter widgets overview 
Typescript :: nextjs and nodemailer problem after deploy 
Typescript :: flutter create widget for each element of list 
Typescript :: routerextensions nativescript 7 import 
Typescript :: if its past 24 hrs *laravel 
Typescript :: typescript object of objects 
Typescript :: typescript mocha Cannot use import statement outside a module 
Typescript :: What was in Rome that helped Renaissance artists achieve their goal of Humanism? 
Typescript :: UpdateTable operation with the GlobalSecondaryIndexUpdates parameter 
Cpp :: conda list envs 
Cpp :: qchar to char 
Cpp :: arduino sprintf float 
Cpp :: c++ read console input 
Cpp :: sfml set font 
Cpp :: double max value c++ 
Cpp :: search update delete files in c++ 
Cpp :: c++ writing to file 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =