const foo = {};
['bar', 'baz'].forEach((word) => {
foo[word] = []
});
The above gives me the following error:
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'. No index signature with a parameter of type 'string' was found on type '{}'.
How do I fix this? You can try it here: