If I have an array of strings like this:
const arr = ["a", "b", "c"];
How can I convert it into an object where these values become keys?
const obj = {
a: "can be anything",
b: 2,
c: 0
}
I attempted to use
type TupleToObject<T extends readonly string[]> = {
[P in T[number]]: any;
};
but it doesn't appear to be strongly typed.