Edited: Change ids type
I have an array with the following values
const ids: number[] = [45, 56];
const obj: any = {
45: "HELLO",
56: "WORLD",
};
I would like to type the current any type of my object to restrict it to my ids array values.
I tried with lookup type but I didn't succeed…
Any idea ?
Regards
const ids: string[] = [45, 56];is in error;45and56are notstrings.