export enum r { color1 = "Red" color2 = "green" color3 = "blue"}ar = ["color1", "color2"];ar.map(e => { if (r[e as any] !== undefined) { return r[e] }})
Above statement giving "Element implicitly has an any type because index expression is not of type number"