Typescript: how can i work with dynamic keys in an object?
Example:
type DynamicObject = {
[key: string]: string;
};
const obj: DynamicObject = {
prop1: 'value1',
prop2: 'value2'
};
In TypeScript, you can use index signatures (like `[key: string]: string`) to allow for dynamic keys in an object.