Let's say I have this:
const color = {
red: null,
green: null,
blue: null
};
const newColor = ['red', 'green', 'blue'].filter(e => color[e]);
The error is in color[e] near the bottom with:
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ red: null; green: null; blue: null; }'. No index signature with a parameter of type 'string' was found on type '{ red: null; green: null; blue: null; }'.
I tried looking everywhere on TypeScript docs, but how the heck am I suppose to interface this so it can accept color[e]?